<    April 2017    >
Su Mo Tu We Th Fr Sa  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
00:03 bturnbull joined
00:04 dsimon joined
00:05 jkreeftmeijer joined
00:11 jkreeftmeijer joined
00:11 duane joined
00:17 dsimon joined
00:19 robinsjdotcom joined
00:19 rozap joined
00:21 jkreeftmeijer joined
00:21 duane joined
00:24 rschmukler joined
00:31 jkreeftmeijer joined
00:32 sid_fules joined
00:34 Ayey_ joined
00:34 maxirater joined
00:37 <Sgeo__> Weird question has anyone recently spammed any virus signature thing?
00:37 <Sgeo__> Because my AV picked up something in my logs for here and #haskell as malicious, not sure what
00:40 robinsjdotcom joined
00:41 nighty-- joined
00:42 jkreeftmeijer joined
00:50 steffkes joined
00:50 steffkes joined
00:52 jkreeftmeijer joined
00:54 jhack joined
01:02 robinsjdotcom joined
01:03 jkreeftmeijer joined
01:04 <ultra|lazer> I haven't seen anything like that in the past few days
01:05 alekx joined
01:06 alekx left
01:08 Ayey_ joined
01:11 PaReeOhNos joined
01:14 jkreeftmeijer joined
01:17 codestorm joined
01:18 elgenie joined
01:21 codestorm joined
01:24 robinsjdotcom joined
01:24 jkreeftmeijer joined
01:30 jkreeftmeijer joined
01:39 tomterl joined
01:41 jkreeftmeijer joined
01:47 robinsjdotcom joined
01:51 jkreeftmeijer joined
01:52 smt joined
02:02 jkreeftmeijer joined
02:07 elgenie joined
02:08 Ayey_ joined
02:12 jkreeftmeijer joined
02:23 jkreeftmeijer joined
02:24 whharris joined
02:25 PaReeOhNos joined
02:28 rschmukler joined
02:33 jkreeftmeijer joined
02:39 wong2 joined
02:39 jkreeftmeijer joined
02:43 codestorm joined
02:50 jkreeftmeijer joined
02:51 steffkes joined
02:52 smt joined
02:52 toastytheog joined
02:52 rschmukler joined
02:52 whharris joined
02:56 smt joined
02:56 meandi joined
03:00 jkreeftmeijer joined
03:01 Siyo joined
03:01 Siyo joined
03:03 whharris_ joined
03:03 RexM_ joined
03:06 Antiarc joined
03:07 elgenie joined
03:09 icecreamcohen joined
03:10 jkreeftmeijer joined
03:13 codestorm joined
03:16 rschmukler joined
03:21 jkreeftmeijer joined
03:27 Sgeo joined
03:32 jkreeftmeijer joined
03:33 PaReeOhNos joined
03:35 sid_fules joined
03:42 jkreeftmeijer joined
03:49 brohith joined
03:53 jkreeftmeijer joined
04:03 jkreeftmeijer joined
04:08 bloosi joined
04:09 jkreeftmeijer joined
04:10 codestorm joined
04:14 chrismccord joined
04:18 jarray52 joined
04:19 jkreeftmeijer joined
04:21 Cohedrin joined
04:24 nahtnam joined
04:28 rschmukler joined
04:30 jkreeftmeijer joined
04:31 codestorm joined
04:36 rschmukler joined
04:38 PaReeOhNos joined
04:40 jkreeftmeijer joined
04:42 toastytheog joined
04:45 Cohedrin joined
04:46 jkreeftmeijer joined
04:48 robinsjdotcom joined
04:51 akeating joined
04:51 wsieroci joined
04:52 steffkes joined
04:54 toastytheog joined
04:57 jkreeftmeijer joined
05:07 jkreeftmeijer joined
05:17 jkreeftmeijer joined
05:24 Cohedrin joined
05:28 jkreeftmeijer joined
05:31 rschmukler joined
05:38 rschmukler joined
05:39 jkreeftmeijer joined
05:47 nd___ joined
05:48 PaReeOhNos joined
05:49 rschmukler joined
05:49 jkreeftmeijer joined
05:51 nickjj_ joined
05:55 cemilowski joined
05:56 r00tl3ss joined
06:00 jkreeftmeijer joined
06:10 jkreeftmeijer joined
06:12 dsimon joined
06:14 bloosi joined
06:16 josevalim joined
06:18 nd___ joined
06:21 jkreeftmeijer joined
06:23 robinsjdotcom joined
06:23 cemilowski joined
06:23 robinsjdotcom joined
06:29 toastytheog joined
06:32 jkreeftmeijer joined
06:34 Cohedrin joined
06:40 stephen_m joined
06:42 jkreeftmeijer joined
06:43 jkreeftmeijer joined
06:45 gvaughn joined
06:48 jkreeftmeijer joined
06:53 steffkes joined
06:53 steffkes joined
06:55 PaReeOhNos joined
06:57 Ayey_ joined
06:58 asabil joined
06:59 asabil joined
07:05 codestorm joined
07:07 tuacker joined
07:12 cemilowski joined
07:13 Guest67 joined
07:15 gokr joined
07:17 bigkevmcd joined
07:18 jarray52 left
07:20 dastagg joined
07:21 mhutter joined
07:26 tomaz_b joined
07:27 vaultin joined
07:29 mark_66 joined
07:36 jkreeftmeijer joined
07:37 robinsjdotcom joined
07:40 elgenie joined
07:40 ultra|lazer joined
07:44 cemilowski joined
07:44 jkreeftm_ joined
07:46 akeating joined
07:48 ZippoWeb joined
07:52 milad joined
07:56 asabil joined
07:57 marr joined
07:59 codestorm joined
08:03 ultralazer joined
08:05 PaReeOhNos joined
08:10 PaReeOhNos joined
08:23 mattyw joined
08:23 jkreeftmeijer joined
08:24 asabil joined
08:28 meandi joined
08:32 vmoravec joined
08:33 gvaughn joined
08:35 lexmag_ joined
08:45 mattyw joined
08:53 codestorm joined
08:54 steffkes joined
09:01 josevalim joined
09:03 elgenie joined
09:08 sid_fules joined
09:12 robinsjdotcom joined
09:16 Ven joined
09:17 pota joined
09:18 codestorm joined
09:21 wsieroci joined
09:21 gokr joined
09:23 sid_fules joined
09:28 jkreeftm_ joined
09:36 cemilowski joined
09:38 wsieroci joined
09:38 colrack joined
09:39 gokr joined
09:41 <linduxed> hey
09:42 <linduxed> hey guys, i just noticed that the new version of pheonix-ecto changes the default time type from :datetime (which is equivalent to :utc_datetime) to :naive_datetime
09:42 <linduxed> i was thinking that it could be good to be in line with the defaults
09:43 nd___ joined
09:43 <linduxed> since i don't really feel like having every timestamp() call needing the type: utc_datetime option
09:43 <linduxed> which would be in every migration and every model that has timestamps
09:44 <linduxed> i basically thought "how bad would it be to migrate all the data to naive_datetime?"
09:44 <linduxed> i'm currently unsure
09:44 rschmukler joined
09:44 <linduxed> or maybe you guys have some good advice on how to handle the situation?
09:45 <linduxed> someone who maybe has already gone through a similar situation?
09:47 <gazler> linduxed: You shouldn't need to change anything, the underlying data type in the database is the same.
09:48 <gazler> The only difference is you might get some warnings in the migrations.
09:50 codestorm joined
09:50 <linduxed> well, i want to eliminate all the warnings
09:51 Ven joined
09:53 <gazler> Oh, actually, there is a difference with the microseconds on timestamps. I was using them prior to 2.1 anyway which is why it didn't impact me.
09:55 <linduxed> well, i suspect that our problem will not be with the microseconds, but with the fact that we use :utc_datetime, but :naive_datetime is the default
09:55 m1dnight_ joined
09:55 <linduxed> right now, i'm changing every invocation of timestamp to use the :type option, but i was hoping there was a less messy way
09:55 <linduxed> maybe it's not THAT messy, but i was still curious
09:56 <gazler> You can set @timestamp_opts in model/schema.ex
09:56 <linduxed> hmmm, i don't think we have such a file in our project'
09:56 <gazler> https://hexdocs.pm/ecto/Ecto.Schema.html#module-schema-attributes
09:56 <linduxed> is that a new concept?
09:56 <gazler> linduxed: It's in web.ex actually
09:57 <gazler> When you do use MyApp.Web, :model
09:57 <gazler> So you can specify the module attribute in there.
10:00 <linduxed> ah, i see!
10:01 <linduxed> good point!
10:01 <linduxed> but, is there something like this for the migration files too?
10:01 gokr joined
10:05 <gazler> linduxed: Not that I know of. You could probably do something like: find priv/repo/migrations/*.exs -type f -exec sed -i -e 's/:datetime/:utc_datetime/g' {} \;
10:06 <gazler> Since the end result of the migration will be the same, I don't see any issue with modifying them.
10:07 <linduxed> yeah, we did that already
10:07 <linduxed> along with this
10:08 <linduxed> sed -ri 's/timestamps\(\)/timestamps\(type: :utc_datetime\)/' priv/repo/migrations/*
10:08 <gazler> Your use of sed is more pro than mine. :)
10:17 r00tl3ss joined
10:20 <Havvy> gazler: Their name has "linux" in it. I would hope so.
10:22 gvaughn joined
10:33 dimitarvp joined
10:36 josevalim joined
10:40 <linduxed> haha, linduxed is not quite "linux", but it is related
10:40 <linduxed> this is not the forum for story time, however :-P
10:44 gokr joined
10:44 codestorm joined
10:53 Guest67_ joined
10:54 steffkes joined
10:58 jkreeftmeijer joined
11:02 Ven joined
11:04 elgenie joined
11:04 rschmukler joined
11:12 imack joined
11:19 jkreeftmeijer joined
11:20 jkreeftm_ joined
11:21 <m1dnight_> What's the best way to resolve a hostname (e.g., .hosts.erlang) to an ip?
11:23 yourname1 joined
11:23 dimitarvp joined
11:26 jkreeftmeijer joined
11:30 <OliverMT> I am getting unbound variable a on this query https://gist.github.com/olivermt/4b61d3df64facd1efa7231b5dbabcace
11:30 <OliverMT> cant I select a whole row into a single variable?
11:30 <OliverMT> oh wait
11:30 <OliverMT> I get it on the group by
11:30 <OliverMT> do I need to explicitly list the entire join row when using count maybe?
11:32 bturnbull joined
11:32 jkreeftm_ joined
11:36 gokr joined
11:36 milad joined
11:38 codestorm joined
11:39 vmoravec joined
11:48 milad joined
11:51 robinsjdotcom joined
12:01 cristianR_ joined
12:03 asabil joined
12:07 Ven joined
12:09 nd____ joined
12:10 gvaughn joined
12:12 gmcabrita joined
12:14 cemilowski joined
12:26 harfangk joined
12:32 codestorm joined
12:33 maxirater joined
12:35 Ven_ joined
12:38 jkreeftmeijer joined
12:38 duane_ joined
12:40 segmond joined
12:43 hbraun joined
12:47 bloosi joined
12:47 laut joined
12:54 Ven_ joined
12:55 PaReeOhNos joined
12:55 steffkes joined
12:55 steffkes joined
13:00 milad joined
13:01 rodolfojcj joined
13:01 balo_ joined
13:02 ikcerog joined
13:03 ramortegui joined
13:05 elgenie joined
13:07 <smeevil_> I'm stuck with a grouped where query, basically i want this : where([c], [c.skill_id == ^skill_id, c.rating >= ^rating]) but it throws that it expects a keyword list at compile time. I'm not sure what i'm doing wrong here ?
13:07 whharris joined
13:11 <smeevil_> ah, its where([c], c.skill_id == ^skill_id and c.rating >= ^rating)
13:14 stephen_m joined
13:15 jadlr joined
13:18 sfbw joined
13:18 akeating joined
13:19 sfbw joined
13:21 ctp joined
13:23 nighty-- joined
13:23 josevalim joined
13:24 <cristianR_> Hello
13:26 codestorm joined
13:27 bpmcd joined
13:28 meh` joined
13:33 JEG2 joined
13:35 Ven joined
13:49 whharris joined
13:49 chrismccord joined
13:51 maxbeizer joined
13:51 smt_ joined
13:52 smt joined
13:54 Ven_ joined
13:59 gvaughn joined
14:07 josevalim joined
14:08 deanh joined
14:08 <m1dnight_> Does `mix test` not start the applicatoin by default?
14:08 <m1dnight_> I read online it does?
14:09 <m1dnight_> (It doesn't for me I think. Veirifed with IO.puts)
14:09 <m1dnight_> oh, no wait debugger. that might be it.
14:10 pliniker left
14:11 bpmcd joined
14:15 rschmukler joined
14:15 akeating joined
14:16 jkreeftm_ joined
14:19 Ven joined
14:19 <m1dnight_> Hrm. This is weird. I have an application that starts an erlang boot server.
14:19 <m1dnight_> when I fire up the application from the repl it works just fine.
14:20 <m1dnight_> but when I do it with mix test I _think_ the boot server is not online
14:20 <m1dnight_> what could be missing here?
14:20 <m1dnight_> I start the normal application with: iex --cookie foo --name "master@" -S mix run
14:20 <m1dnight_> and the test with iex --cookie foo --name "master@" -S mix test
14:21 codestorm joined
14:21 Ayey_ joined
14:21 RexM joined
14:23 _Mzungu_ joined
14:37 rschmukler joined
14:44 chrismccord joined
14:46 hotpancakes joined
14:46 <cristianR_> I'm testing a phoenix application with 2k websockets. I'm gathering metrics using influx. One of the metrics is the number of gen_servers in a process registry. Yesterday, all gen_servers stopped (terminated by the supervisor I guess). The problem the file log stops exactly at that moment, no error reported. However I can see that influx is still receiving metrics from the app.
14:47 <cristianR_> is it possible that the logging mechanism crashes?
14:47 <chrismccord> cristianR_ : have you checked your server logs? Maybe an OOM killer took the app out and it restarted?
14:50 kevwil joined
14:50 optikfluffel joined
14:50 <cristianR_> chrismccord: in that case the log should contain phoenix startup message after the restart, shouldn't it?
14:50 optikfluffel joined
14:51 <chrismccord> cristianR_ : you would think. If a supervisor was dying and nuking all the children, you'd get that in the error logs
14:51 elixir1208 joined
14:52 <elixir1208> Hi, learning plug now and I don't think I'm understanding the hoopla. Just seems like chainable functions, no?
14:53 <cristianR_> chrismccord: indeed, that's why I'm a bit perplexed by the fact that the output just stops, nothing is logged anymore
14:54 <cemilowski> elixir1208: As I understand it's like chainable functions with "stop here" ability.
14:54 codestorm joined
14:54 <elixir1208> cemilowski: yeah, you mean "halt"?
14:54 <chrismccord> elixir1208 : exactly. You actually are understanding 90% of plug if that's where you're at :)
14:55 Ayey_ joined
14:55 <cemilowski> elixir1208: Yeap. I mean, "don't continue", "response now", or "halt"...
14:55 <chrismccord> the other bits are plug's `init` calls are compile time computed
14:55 <elixir1208> chrismccord: omg, so you guys aren't trying to take over the world with another bloated abstraction??!! I actually love it... :D
14:56 <chrismccord> beyond that', that's it! It's a simple, beautiful contract
14:56 <chrismccord> hehe :)
14:57 steffkes joined
14:57 steffkes joined
14:57 <elixir1208> chrismccord: why does this always happen to me? "I don't like it because it's not complicated"....."oh, wait, more of that. I actually like that a lot!"
14:58 <elixir1208> chrismccord: anyway, many thanks to you and jose and the rest of the wonderful elixir community! :)
15:00 <cristianR_> chrismccord: I'll try adding the option handle_sasl_reports: true to :logger, it seems that there are certain errors that happen inside :gen_server that are not logged otherwise.
15:09 codestorm joined
15:11 Ayey_ joined
15:17 Ayey_ joined
15:18 <nox> What's hoopla?
15:24 hotpancakes joined
15:25 cevado joined
15:25 elgenie joined
15:25 MotherFlojo joined
15:27 bvcosta joined
15:33 hotpancakes joined
15:34 hotpanca_ joined
15:35 dean joined
15:37 tuacker joined
15:38 Ayey_ joined
15:41 milad joined
15:42 meh` joined
15:43 icecreamcohen joined
15:46 Ayey_ joined
15:46 mr_bmt joined
15:51 rozap joined
15:52 amclain joined
15:52 davidw joined
15:53 bturnbull joined
15:55 strykerkkd joined
16:00 duane joined
16:03 jkreeftmeijer joined
16:04 ZippoWeb joined
16:06 hotpancakes joined
16:07 josevalim joined
16:07 hotpanca_ joined
16:11 bturnbull joined
16:11 meandi_2 joined
16:12 hotpancakes joined
16:16 wsieroci joined
16:17 <nox> How are things going around here btw?
16:19 <micmus> nox: I broke the erlang compiler
16:19 M04n0[m] joined
16:20 <nox> micmus: Nice, how?
16:20 <bitmod> should base case or recursive case be defined first in a module?
16:20 <micmus> nox: I made the optimizer smarter than the sanity check later on
16:20 <nox> Neat.
16:20 <micmus> nox: https://github.com/erlang/otp/commit/0377592dc2238f561291be854d2ce859dd9a5fb1 see the comment below
16:21 <nox> micmus: Failed consistency checks are sad.
16:22 sfbw joined
16:23 <nox> micmus: But better than a passing consistency check and then the module segfaults the VM. :P
16:24 <josevalim> micmus: awesome :D
16:24 <micmus> I'm pretty sure the problem here is the check being not smart enough - beam_validate does not see bs_get_float2 will extract a float and not any term from binary
16:24 imack joined
16:25 <nox> micmus: Oh you managed to optimise integer range checks?
16:25 <nox> That's so long overdue.
16:25 imack joined
16:25 <micmus> nox: not really
16:25 <josevalim> micmus: it seems it is optimized "only" on binaries, right?
16:25 <bitmod> josevalim, should base case or recursive case be defined first in elixir?
16:26 <josevalim> bitmod: it doesn't matter as long as the clauses do not conflict
16:26 hotpancakes joined
16:26 <micmus> nox: I only tought the optimizer about binary operations, and that getting unicode from binary will return something within unicode bounds
16:26 <micmus> the integer check was already there, though
16:26 <bitmod> thanks
16:27 <nox> micmus: Oh.
16:27 <josevalim> otherwise the subset first, superset later
16:27 <nox> Oh wait yeah, josevalim optimised the integer checks earlier, right?
16:27 bturnbull joined
16:27 <josevalim> nox: it depends on your definition of optimization
16:28 Ayey_ joined
16:28 <josevalim> i have inlined the code in the vm to have less jumps
16:28 <micmus> nox: but the optimizer was throwing away any type information on any binary operation
16:28 <nox> That's already better than what was before josevalim. :)
16:28 <nox> micmus: Oh!
16:28 <nox> I see.
16:29 <micmus> I was bothered by the example in the commit - <<x::utf8, _::rest>> when x in a..b normally expands to when is_integer(x) and x >= a and x <= b
16:29 <micmus> And the compiler didn't optimize away the is_integer check
16:29 <micmus> that's how it started :D
16:31 hahuang65 joined
16:33 rozap joined
16:33 toastytheog joined
16:33 <micmus> josevalim: the struct matching optimization is also pending - but I'm not sure where it should be done
16:33 gem joined
16:33 <micmus> in elixir AST level, in core erlang or there - at the lowest level
16:34 <nox> micmus++
16:34 <nox> Oops, this is Freenode.
16:34 <micmus> Probably Elixir AST would be nicest, but we don't do any type information analysis in the Elixir compiler
16:34 <nox> Most Moz channels have a karma bot. :)
16:34 <josevalim> micmus: so if the erlang compiler can keep more type information to avoid doing type checks, that would be preferrable
16:34 <josevalim> micmus: the struct analysis though would be straight-forward
16:35 <josevalim> because that's handled by the compiler
16:35 <nox> Struct?
16:35 <micmus> nox: maps with magic key __struct__ - elixir's replacement for records
16:35 codestorm joined
16:36 <micmus> josevalim: we would need to track the type probably in the translation pass, is that right?
16:36 <micmus> or would tracking do into expansion, but we would simply generate simpler code during translation?
16:39 <nox> inb4 Insta r- from Erlang team. :P
16:40 sfbw joined
16:40 Ayey_ joined
16:41 sfbw joined
16:42 sfbw_ joined
16:43 sfbw joined
16:43 <micmus> One observation I have from playing with OTP directly is that running tests there is a pain :(
16:44 sfbw_ joined
16:45 sfbw joined
16:45 codestorm joined
16:46 sfbw_ joined
16:46 hotpancakes joined
16:47 sfbw joined
16:47 <benwilson512> micmus: what's the __struct__ related optimization?
16:48 <bitmod> benwilson512, are function clauses reordered when a program is run?
16:48 <micmus> benwilson512: I described it here https://github.com/erlang/otp/pull/1414#issuecomment-295415248
16:48 sfbw joined
16:48 <benwilson512> bitmod: likely re-ordered at compile time
16:48 <micmus> bitmod: they might be, but the observable behavior won't change
16:48 <bitmod> benwilson512: do you know how?
16:49 <benwilson512> bitmod: not even a little, but I mean that's pretty normal with compiled languages
16:49 <micmus> i.e. they will appear as if they were matched in order
16:49 <benwilson512> the compiler does all sorts of optimizations
16:49 <benwilson512> micmus: ah nice
16:49 sfbw joined
16:50 <benwilson512> micmus: oh man that'd be a big win in absinthe
16:50 <benwilson512> we do that exact example everywhere
16:50 <benwilson512> ah although I guess we generally don't have the inner struct
16:50 <bitmod> i'm curious, jose said it doesn't matter if base or recursive case goes first in a module, e.g. https://paste.ubuntu.com/24427727/, but wouldn't there be a (albeit slight) performance difference between the two? (program 1: the paste.ubuntu link, program 2: same program but the sum clauses are swapped)
16:50 <micmus> benwilson512: yeah, it's pretty common in elixir
16:50 sfbw joined
16:50 <benwilson512> bitmod: if the matches were a linear search in the order provided sure
16:51 <benwilson512> but matches can get compiled too all kinds of stuff
16:51 <benwilson512> *to
16:51 <benwilson512> bitmod: as with all microbenchmarks you gotta just measure
16:51 <benwilson512> you could probably try to check the ultimate assembly
16:51 <benwilson512> or rather BEAM bytecod
16:51 sfbw joined
16:51 <benwilson512> micmus is probably up on how to do that
16:52 <bitmod> benwilson512: ah ok. so basically there's no hard and fast rule about whether base or recursive case should be defined first? is there one that elixir prefers?
16:52 <benwilson512> bitmod: personally I prefer base cases
16:52 <z1mvader> \join fedora-admin
16:52 <benwilson512> I think it's useful to consider when the loop terminates
16:52 sfbw joined
16:52 <bitmod> benwilson512: if the language doesn't have pattern matching base case must always come first right?
16:53 <benwilson512> bitmod: if the language doesn't have pattern matching you generally don't write multiple functions with the same name
16:53 <benwilson512> they aren't really commensurable situations
16:53 <bitmod> fair point
16:53 <bitmod> thanks for clearing that up at any rate
16:53 sfbw joined
16:54 icecreamcohen joined
16:54 rodolfojcj joined
16:54 sfbw joined
16:55 rschmukler joined
16:56 <micmus> bitmod: it sometimes matters, but not in this case
16:56 mika__ joined
16:56 pragmatism joined
16:56 <micmus> you effectively have "if empty" check on one clause and "if not empty" on the other
16:56 <micmus> if you had the check only on one clause, it would matter
16:57 deanh joined
16:57 steffkes joined
16:59 milad joined
17:01 Ayey_ joined
17:04 hotpanca_ joined
17:06 asabil joined
17:07 <asonge> as a general rule, i put base cases up top, because there are sometimes multiple non-recursive cases, and sometimes you want to make sure that you don't accidentally recurse forever if a recursive case is not mutex.
17:07 rschmukler joined
17:07 <asonge> but i find that i don't write all that many recursive functions anymore, or if i do, they're sometimes a code smell (you mix the recursive flow with the logic to transform, so it's harder to refactor)
17:10 ctp joined
17:13 imack joined
17:13 <micmus> bitmod: I just checked your example, and the compiler emits exactly the same bytecode, no matter the order of the clauses
17:14 <bitmod> micmus: ah awesome, thanks for that
17:17 <micmus> bitmod: here's the assembly for it, if you're interested :D https://www.irccloud.com/pastebin/33zWdBum/
17:18 <asonge> one day i really want to understand how the pattern matching optimizer works
17:19 meandi joined
17:23 Cohedrin joined
17:24 mhutter joined
17:25 PaReeOhNos joined
17:25 sfbw joined
17:25 gem joined
17:25 Ayey_ joined
17:29 rschmukler joined
17:31 jeffweiss joined
17:33 ZippoWeb joined
17:33 icanhazbroccoli joined
17:33 maxbeizer joined
17:33 mjanssen left
17:39 hotpancakes joined
17:45 Ayey_ joined
17:46 ikcerog joined
17:47 refriedchicken joined
17:50 mika__ joined
17:57 wsieroci joined
18:02 veytarn joined
18:04 ctp joined
18:04 jkreeftmeijer joined
18:07 Ayey_ joined
18:09 squallstter joined
18:11 rschmukler joined
18:11 weaksauce joined
18:12 Uniaika joined
18:13 Ayey_ joined
18:16 icanhazbroccoli joined
18:20 refriedchicken joined
18:22 <alisdair> it basically just checks the types of the inputs and then builds a tree
18:22 <alisdair> with some special cases like `[]`
18:22 rschmukler joined
18:22 <alisdair> it doesn't really reorder clauses
18:24 toastytheog joined
18:25 milad joined
18:34 Ayey_ joined
18:35 lexmag joined
18:36 dean_ joined
18:37 wsieroci joined
18:39 ultra|lazer joined
18:41 wyzzard_ joined
18:41 hotpancakes joined
18:42 <wyzzard_> Does anyone here have experience with multitenancy and migrations in phoenix?
18:43 <wyzzard_> I’m trying to figure out if I can tell if a migration has been run with a prefix passed in
18:43 hotpanca_ joined
18:47 tomaz_b joined
18:48 <cristianR_> I just ran a test and I got a bad argument from :erlang.binary_to_existing_atom/2, however there is a gen_server that explicitly uses the atom
18:48 <cristianR_> are the atoms created dynamically at runtime?
18:49 <cristianR_> can :erlang.binary_to_existing_atom/2 fail at runtime depending if the code that defines the atom is running or not?
18:54 bturnbull joined
18:56 icecreamcohen joined
18:59 rschmukler joined
19:02 <ultra|lazer> I'm kind of planning stages of a rest api, and was wondering if Poison is enough to turn an ecto get into a json object
19:04 steffkes joined
19:04 steffkes joined
19:06 <ljarvis> ultra|lazer: what do you mean an ecto get? the record is just a map, right?
19:06 <ultra|lazer> Yeah
19:07 <ultra|lazer> I should be able to just poison.encode the result and then serve that, right?
19:07 <ljarvis> yeah, give it a shot
19:08 <ultra|lazer> Will do, thanks
19:08 chrismccord joined
19:09 rschmukler joined
19:09 Ayey_ joined
19:10 codestorm joined
19:10 milad joined
19:14 wsieroci joined
19:14 PaReeOhNos joined
19:15 mitchellhenke joined
19:16 <mitchellhenke> are dependencies always compiled under production mix env, even if MIX_ENV=dev is specified?
19:19 DeadTrickster joined
19:20 milad joined
19:21 InternetFriend joined
19:23 hotpancakes joined
19:24 rschmukler joined
19:31 hotpancakes joined
19:32 hotpanca_ joined
19:33 toastytheog joined
19:35 LoverOne joined
19:35 <LoverOne> hi
19:35 hotpancakes joined
19:35 <LoverOne> any body here
19:36 <Nicd-> around 583 people
19:43 emancu joined
19:46 Ayey_ joined
19:48 colrack joined
19:48 <DavidAntaramian> Let's say that I have a GenServer managing billing for my application. The messages it receives manipulate a user's available credit in the system. I'm concerned that if/when the system shuts down, any messages left in the process message box will be left to the ether. I've thought about trying to flush them all with a terminate/2 callback, but I'm not sure
19:48 <DavidAntaramian> if that's a good practice.
19:49 <DavidAntaramian> Has anyone solved that type of problem effectively? Or am I looking at it from the wrong perspective?
19:50 cemilowski joined
19:51 mika_ joined
19:51 <sorentwo> DavidAntaramian: That is entirely possible, if there are any messages you may not get them processed. You have the same concerns as a database, where you could get partial writes of data.
19:52 <sorentwo> If the data is critical you should really make it synchronous and ensure it gets into something persistent.
19:52 <sorentwo> That's why databases usually have two forms of storage, something that is written immediately (WAL) and longer term block storage.
19:57 icecreamcohen joined
20:02 elgenie joined
20:02 rschmukler joined
20:04 <DavidAntaramian> Yes, I have it as a synchronous function currently. But there can be long response times to write the billing data to the third party service, and that affects the block its called in.
20:05 codestorm joined
20:05 <DavidAntaramian> I'm weighing the trade-offs, but yes, the database comparison is on-point
20:05 <DavidAntaramian> thanks sorentwo
20:06 jkreeftmeijer joined
20:06 jdqx joined
20:09 <sorentwo> DavidAntaramian: I'm not sure what your environment is, but you may want to use dets to have some protection against restarts or a persistent queue like rabbit/redis to store the data and process async that way.
20:10 <emancu> Hello everyone! I have a question bout phoenix, ecto and nested relationships. Lets say: a Post has_many Comments and the Comment.changelog validates_required([:text, post_id]). The thing is, Ecto fails when I use `cast_assoc(:comments)` from Post because it says the `post_id` is not present (which is true). Should I remove the `post_id` from the validation_require list ?
20:12 <wyzzard_> Is there any way to copy the body of a function from one module but run it in the context of another?
20:13 <icecreamcohen> wyzzard_: is that function using module attributes or something?
20:14 <wyzzard_> I would like to run exactly the same function but override one of the function calls it makes
20:14 <DavidAntaramian> sorentwo: i've thought of that, but I don't know that the benefit - complexity it introduces justifies it. It's designed so that any data loss would be in the client's favor, so at least there that :)
20:14 <wyzzard_> import does not seems to work the way I want it to
20:14 fhoffmann joined
20:15 <wyzzard_> I am trying to write a tenant.migrate mix task for phoenix
20:15 <icecreamcohen> wyzzard_: you could pass in the module where those functions are defined to the function that calls them.
20:15 <wyzzard_> I want to delegate all of the responsibility to the default migrate task from Ecto
20:16 <wyzzard_> icecreamcohen: Can you demonstrate that?
20:16 <icecreamcohen> sure, 1s
20:16 Ayey_ joined
20:18 <sorentwo> DavidAntaramian: It sounds like you're aware of the trade off, I'd go with the lighter weight implementation at first. If any transactions go missing you'll have a good hunch about what happened.
20:20 rodolfojcj joined
20:20 <icecreamcohen> wyzzard_: https://gist.github.com/scohen/6c17b724bd1599ef0daf198e22759613
20:27 <wyzzard_> icecreamcohen: https://gist.github.com/tomciopp/4a1fc01d03baffe52c3424d6d6f34874
20:27 mhutter joined
20:27 <wyzzard_> That gives a bit more context into the problem I am having
20:28 rschmukler joined
20:28 <icecreamcohen> warning, i’ve never used ecto / phoenix
20:29 <wyzzard_> I can do this with modules in Ruby, by just including the module into a class
20:29 <wyzzard_> that was what I expected `import` to do
20:29 <icecreamcohen> Modules in elixir are just places to put functions.
20:30 rschmukler joined
20:30 meandi joined
20:31 hotpancakes joined
20:31 hotpanca_ joined
20:33 <icecreamcohen> wyzzard_: what needs to change in this?
20:33 <icecreamcohen> the migrator?
20:34 <wyzzard_> so the migrations_path at the bottom is what I want to use when calling `run`
20:34 <wyzzard_> that replaces the call that is defined in Mix.Ecto
20:34 <wyzzard_> which we do not import
20:35 <icecreamcohen> oh, i see
20:35 <wyzzard_> I expected that to work as written, but I get an error that says “run” is undefined
20:36 <icecreamcohen> so, if you don’t control the run function (it’s defined in Mix.Ecto, most likely) then I don’t think you can do what you want in this way.
20:37 <icecreamcohen> someone else can jump in, but I think I’m right about that.
20:37 <icecreamcohen> is the run method in the gist from ecto’s mix task?
20:38 <icecreamcohen> what you might be able to do is define a migrator function
20:39 <icecreamcohen> that ignores the migrations_path argument
20:39 <icecreamcohen> like migrator = fn (repo, _, direction, opts) -> Ecto.Migrator.run(repo, migrations_path(), direction, opts) end
20:40 <icecreamcohen> and then in your mix task define run and just call Mix.Ecto.run(args, migrator)
20:41 <wyzzard_> hmm… interesting
20:42 subetei joined
20:42 Ayey_ joined
20:42 Cohedrin joined
20:43 Ilyes512 joined
20:45 jeffweiss joined
20:54 Ayey_ joined
20:57 toastytheog joined
20:58 <wyzzard_> icecreamcohen: Thanks for the advice! I’ve got everything up and running
20:58 <icecreamcohen> great, glad it worked.
20:58 <wyzzard_> I should prob write a blog post about all of this
20:59 <icecreamcohen> that might be helpful to others. Especially the change in mentality about what modules do.
20:59 codestorm joined
21:03 <wyzzard_> Yeah there’s some cool stuff I’m doing here as well, I’ve got two different directories for migrations
21:04 <wyzzard_> The tenants one will automatically run for all existing tenants, but will also run whenever a new tenant is created in the admin portal
21:04 <wyzzard_> so you don’t have to have a devops person in the loop if you add a new tenant
21:04 asabil joined
21:05 steffkes joined
21:05 steffkes joined
21:07 asabil joined
21:12 sfbw joined
21:17 elgenie joined
21:18 icanhazbroccoli joined
21:18 rschmukler joined
21:23 hotpancakes joined
21:25 codestorm joined
21:30 ramortegui left
21:36 rschmukler joined
21:38 bturnbull joined
21:38 milad joined
21:39 codestorm joined
21:50 hotpancakes joined
21:50 Ayey_ joined
21:52 duane joined
21:57 tuelz joined
21:57 <tuelz> anyone know an erlang term diff library?
21:59 <tuelz> looking to find the diff of deeply nested data structs composed of lists/tuples/strings
22:00 vaultin joined
22:01 rschmukler joined
22:02 Guest17 joined
22:08 hotpancakes joined
22:09 jkreeftmeijer joined
22:19 Ayey_ joined
22:21 akovari joined
22:23 sfbw joined
22:28 rschmukler joined
22:32 MotherFlojo joined
22:32 rschmukler joined
22:34 milad joined
22:38 mika_ joined
22:39 hotpancakes joined
22:40 hotpancakes joined
22:40 Ayey_ joined
22:44 mika_ joined
22:47 rozap joined
22:51 mika_ joined
22:52 hotpancakes joined
22:52 josevalim joined
23:06 steffkes joined
23:08 nd___ joined
23:09 DTZUZU joined
23:12 hotpancakes joined
23:12 jkreeftmeijer joined
23:15 jeffweiss joined
23:16 Ayey_ joined
23:20 tuelz joined
23:28 reset joined
23:28 milad joined
23:29 nighty-- joined
23:29 mhutter joined
23:30 hotpancakes joined
23:32 PaReeOhNos joined
23:34 mitchellhenke joined
23:37 duane joined
23:41 codestorm joined
23:42 rschmukler joined
23:42 InternetFriend joined
23:42 rodolfojcj joined
23:45 bambanx joined
23:47 elgenie joined
23:48 duane_ joined
23:51 mika_ joined
23:51 asabil joined
23:52 Ayey_ joined