<    April 2017    >
Su Mo Tu We Th Fr Sa  
                   1  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
30
00:00 rschmukler joined
00:02 jkreeftmeijer joined
00:05 lsiqueira joined
00:06 meandi left
00:10 tolerablyjake joined
00:11 fschuindt joined
00:12 BenMorganIO joined
00:14 <fschuindt> There's any built in function or trick to return the number without signal like -21 -> 21? I can't find it. Where should I look for it?
00:23 chriswarren joined
00:24 <havenwood> fschuindt: -21 |> abs #=> 21
00:24 <havenwood> fschuindt: https://hexdocs.pm/elixir/Kernel.html#abs/1
00:25 bitshift joined
00:25 <fschuindt> thank you, havenwood
00:25 <havenwood> fschuindt: you're welcome
00:41 griffinb_ joined
00:43 jhack joined
00:43 jhack joined
00:47 marcdel joined
00:48 marcdel_ joined
00:55 mitchellhenke joined
00:58 hellofunk joined
00:59 MotherFlojo joined
01:04 webdev007 joined
01:10 InternetFriend joined
01:31 chriswarren joined
01:39 tomterl joined
01:40 nomicflux joined
01:57 io_bora joined
01:58 InternetFriend joined
02:00 hipertracker joined
02:04 jkreeftmeijer joined
02:06 PaulN joined
02:06 rschmukler joined
02:10 PaulN joined
02:15 icapurro joined
02:32 chriswarren joined
02:45 MotherFlojo joined
02:50 raycoll joined
02:55 Duckily joined
03:11 cevado joined
03:15 josevalim joined
03:16 icapurro joined
03:17 <cevado> is someone using elixir_make? i dont know if i understood it correctly. is it to build anything with a makefile or to build elixir projects with makefile?
03:17 icapurro joined
03:24 racycle joined
03:26 nomicflux joined
03:31 MotherFlojo joined
03:33 chriswarren joined
03:36 <josevalim> cevado: it is to invoke a makefile when building a project with c exts
03:38 MarioBranco joined
03:41 MotherFlojo joined
03:44 DTZUZO joined
03:45 josevalim joined
03:45 jamescarr joined
03:47 MarioBranco joined
03:48 <cevado> thanks josevalim. ^^
03:53 larshesel joined
03:59 chavito joined
04:00 WhiskyRyan joined
04:05 jkreeftmeijer joined
04:08 InternetFriend joined
04:21 jerel joined
04:21 gvaughn joined
04:22 icapurro joined
04:25 JoelMcCracken joined
04:32 jamescarr joined
04:34 chriswarren joined
04:37 <jamescarr> vim test.py
04:37 <jamescarr> oh
04:43 chriswarren joined
04:50 griffinb_ joined
04:52 elixir1932 joined
04:55 cfk joined
04:56 <elixir1932> Hi everyone. I'm new to elixir and trying to write a function that does the following: given an integer, flip a coin. If heads, double the integer; if tails, halve it. Repeat for 1000 iterations. What's the best way to write this function?
05:08 jkreeftmeijer joined
05:16 isubasti joined
05:18 isubasti joined
05:24 icapurro joined
05:24 Reshi joined
05:25 <Reshi> /msg isubasti Yes I am everwhere.
05:38 DTZUZO joined
05:43 chriswarren joined
05:45 Ioyrie joined
05:47 <elixir1932> I just wrote this, but it doesn't work as expected: https://gist.github.com/anonymous/46cb826759b01150f449b90cf9beaf62
05:47 <elixir1932> It only seems to work for one iteration, not 500 as it's supposed to. Any help?
05:49 josevalim joined
05:53 wsieroci joined
05:57 <elixir1932> Anyone still up?
05:58 MotherFlojo joined
06:06 m_m joined
06:09 gvaughn joined
06:13 isubasti joined
06:14 DTZUZO joined
06:27 fschuindt joined
06:29 Ioyrie joined
06:34 tuacker joined
06:43 stephen_m joined
06:44 chriswarren joined
06:50 MotherFlojo joined
06:54 isubasti joined
06:57 ZippoWeb joined
07:01 fschuindt joined
07:09 jkreeftmeijer joined
07:15 isubasti joined
07:19 cemilowski joined
07:25 icapurro joined
07:35 refriedchicken joined
07:36 isubasti joined
07:41 gmcabrita joined
07:43 josevalim joined
07:45 chriswarren joined
07:46 cemilowski joined
07:54 chriswarren joined
07:56 m1nted joined
07:56 isubasti joined
07:58 gvaughn joined
07:58 marr joined
07:59 m_m joined
07:59 milad joined
07:59 milad joined
08:00 sixstone joined
08:02 m_m joined
08:03 chriswarren joined
08:05 nd__ joined
08:08 dani0_ joined
08:11 arkgil joined
08:16 tuacker joined
08:17 isubasti joined
08:25 milad joined
08:38 isubasti joined
08:45 jkreeftmeijer joined
08:49 squallstter joined
08:51 milad joined
08:58 isubasti joined
08:59 jamescarr joined
09:04 chriswarren joined
09:05 icanhazbroccoli joined
09:09 MaSven joined
09:12 josevalim joined
09:19 isubasti joined
09:25 egis joined
09:27 icapurro joined
09:30 rschmukler joined
09:33 jkreeftmeijer joined
09:34 lexmag joined
09:46 gvaughn joined
09:55 milad joined
09:57 icanhazbroccoli joined
10:01 DTZUZO joined
10:05 chriswarren joined
10:09 dani0_ joined
10:13 MotherFlojo joined
10:14 chriswarren joined
10:23 JuanMiguel joined
10:29 jkreeftmeijer joined
10:32 isubasti joined
10:38 MotherFlojo joined
10:47 ejpcmac joined
10:55 isubasti joined
10:59 Guest67_ joined
11:02 isubasti joined
11:05 pHcF joined
11:09 lessless joined
11:11 wsieroci joined
11:15 chriswarren joined
11:20 Duckily joined
11:22 isubasti joined
11:28 icapurro joined
11:35 gvaughn joined
11:36 Liquid_X joined
11:46 isubasti joined
12:01 rschmukler joined
12:09 ivan joined
12:09 isubasti joined
12:16 chriswarren joined
12:17 <ivan> TIL raise macro
12:25 jkreeftmeijer joined
12:30 isubasti joined
12:32 cemilowski left
12:36 rranelli joined
12:39 lexmag_ joined
12:49 isubasti joined
12:49 jamescarr joined
12:50 isubasti joined
12:54 isubasti joined
12:55 DTZUZO joined
12:57 jkreeftmeijer joined
13:01 MotherFlojo joined
13:04 ejpcmac joined
13:16 gvaughn joined
13:16 chriswarren joined
13:17 josevalim joined
13:26 isubasti joined
13:29 icapurro joined
13:30 JuanMiguel joined
13:30 isubasti joined
13:31 am55 joined
13:35 isubasti joined
13:39 travis-ci joined
13:39 <travis-ci> elixir-lang/elixir#14136 (master - b311a62 : José Valim): The build passed.
13:39 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/76269ef53526...b311a62d84a3
13:39 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/217520983
13:39 travis-ci left
13:41 chrismccord joined
13:48 <the_voice_> \o
13:50 gvaughn joined
13:51 gvaughn_ joined
13:53 dimitarvp joined
14:00 cevado joined
14:05 io_bora joined
14:08 isubasti joined
14:17 mitchellhenke joined
14:17 chriswarren joined
14:21 wtetzner joined
14:25 jerel joined
14:26 chriswarren joined
14:29 isubasti joined
14:33 racycle joined
14:33 jkreeftmeijer joined
14:34 chuff joined
14:39 WhiskyRyan joined
14:43 mitchellhenke joined
14:48 lexmag joined
14:50 isubasti joined
14:50 Notimik joined
15:04 <DeadTrickster> chrismccord, hi, how to implement dynamic path prefixes (that thing that configured via :path usually I suppose) e.g. via environment variable?
15:05 nomicflux joined
15:09 griffinb_ joined
15:09 griffinb_ joined
15:11 isubasti joined
15:11 Guest67_ joined
15:12 InternetFriend joined
15:14 chavito joined
15:15 coatezy joined
15:23 jkreeftmeijer joined
15:23 tuacker joined
15:28 chriswarren joined
15:29 WhiskyRyan joined
15:32 isubasti joined
15:37 chriswarren joined
15:42 JuanMiguel joined
15:45 ensyde joined
15:47 fschuindt joined
15:47 DTZUZO joined
15:49 MrFrog joined
15:51 <MrFrog> hey i'm working in phoenix and wrote a controller test to cover when someone's password is invalid and they're updating. for some reason when running tests though i get some "warn" level log entry including `message="The password is too short. At least 8 characters."` in it - what's the right way to clean up my test output when something like that is on purpose?
15:52 <MrFrog> the test is passing and correct - it's just annoying to end up with a bunch of warn messages in the middle of my output for tests like the one i'm describing
15:53 isubasti joined
15:54 <stephen_m> MrFrog - you can change the level for the log in test... for either compilation time or runtime.
15:54 <MrFrog> stephen_m: makes sense, i'm wondering what the "normal" setting is for a project - do people just keep the warns in there? (i didn't set the project up so i'm not sure how close to "normal" it is)
15:54 <stephen_m> I set it to error
15:55 <stephen_m> but i noticed the default from a generator seems to be :warn.
15:55 WhiskyRyan joined
15:55 <stephen_m> that doesn't make sense for me though.
15:56 <MrFrog> ok cool that works for me, i'll do that for now, just seemed like a weird default i guess
15:56 <MrFrog> thanks!
15:56 <stephen_m> you can actually change it for one specific test at runtime if you wanted ...
15:57 <stephen_m> I can't remember which function but i think it is https://hexdocs.pm/logger/Logger.html#configure/1
15:58 cemilowski joined
15:58 <stephen_m> yes, it is ... https://github.com/elixir-lang/elixir/blob/master/lib/logger/lib/logger.ex#L104
15:59 Ven joined
16:00 <MrFrog> oh cool enough
16:01 MotherFlojo joined
16:03 <ejpcmac> Hi, I’m trying to set the default locale for my Phoenix application (like set_locale in PHP) so that Timex.format and Gettext string would be in french, but I don’t find how to do that.
16:04 chuff joined
16:06 <stephen_m> for default locale with gettext -- read here https://github.com/elixir-lang/gettext/blob/v0.13.1/lib/gettext.ex#L98
16:06 <stephen_m> in terms of time and default locale... I'm not sure. not familiar with Timex either. could you not just use UTC on your server?
16:07 <ejpcmac> Thank you for g
16:07 <stephen_m> *meant default timezone*
16:07 <ejpcmac> Gettext*
16:07 <stephen_m> UTC
16:08 <ejpcmac> For Timex, it’s for the string in a human-readable format I talk about
16:09 <ejpcmac> Not the timezone, it’s already in UTC and I have no problems to convert it in the local timezone.
16:10 Fire-Dragon-DoL joined
16:11 <stephen_m> I did implement something of that nature - as a private module inside my application -- if you just mean something like "Thursday, 25th Aug, 5pm" ?
16:11 elixir1928 joined
16:12 <ejpcmac> Yes
16:12 <stephen_m> I'd have thought there would be package for that by now.. It's not hard to write a module for it.
16:13 <elixir1928> Hi everyone. I'm wondering why the following code doesn't work as expected: https://gist.github.com/anonymous/86c848d0032ac046f1778121bf1d7d16 The code should do the following: take an integer, flip a coin and depending on either heads or tails, double the number or halve it. Then repeat 500 iterations.
16:13 <ejpcmac> It’s possible to set the locale with Timex.lformat!, but I think there should be a cleaner way
16:13 nomicflux joined
16:13 <elixir1928> Right now the code only seems to do one iteration.
16:14 isubasti joined
16:15 <elixir1928> Is `Enum.reduce` the right way to do this type of iteration with an accumulator?
16:21 <benwilson512> elixir1928: well, you're reducing over a list of a range
16:21 <stephen_m> elixir1928: what do you want to do with the result of each iteration?
16:21 <benwilson512> which is a bit odd
16:21 <benwilson512> cause it'll run just once
16:21 <benwilson512> not 500 times
16:22 chrisml joined
16:22 <elixir1928> stephen_m: I would like to feed the result of each iteration into the helper function that I've defined.
16:23 <stephen_m> you mean sum each iteration?
16:24 <stephen_m> or just use the result from the previous one as the input for the next one ?
16:24 <elixir1928> stephen_m: nope, I'm actually not using anything from the list at all. I'm just using it to iterate 500 times.
16:24 <elixir1928> stephen_m: yup, the latter.
16:24 <elixir1928> Is there a better way to do it?
16:25 <stephen_m> depends on what you want to do... if the next iteration depends on the previous one, then i suppose you need a recursive function and Enum.reduce works there.
16:25 <elixir1928> stephen_m: That's exactly what I'm going for.
16:26 <elixir1928> But I just don't understand why the function is not working as expected.
16:26 <stephen_m> but in your case, you take a random number each time
16:26 <stephen_m> acc is ignored
16:26 <stephen_m> so the accumulator is doing nothing
16:27 <asonge> elixir1928: [1..500] is a list with a range of 1..500 in it, so it only runs once?
16:27 <asonge> if you wanted to run it 500 times, you'd just pass the range in straight (ranges implement the protocol so you can use them with Enum functions)
16:27 <stephen_m> *actually, no, it seems you are using the accumulator to divide by 2.
16:27 <stephen_m> or multiyl
16:28 <stephen_m> Enum.into(1..500, []) = list
16:28 stephen_m left
16:28 squallstter joined
16:28 stephen_m joined
16:29 <elixir1928> asonge: Ah, that's it!
16:29 <elixir1928> Thanks!
16:30 <asonge> i'd like to point out that benwilson512 told you that, you just misunderstood :)
16:30 <asonge> elixir1928: also, that's not 100% the fastest way, but it's certainly idiomatic(-ish)
16:30 <asonge> unless things are really slow, idioms are better *shrug*
16:30 <elixir1928> benwilson512: Thanks! I totally misunderstood what you said until now.
16:31 <elixir1928> asonge: What would be the faster way to do it?
16:31 <stephen_m> i got cut off there. what was your solution?
16:31 <elixir1928> stephen_m: remove the brackets around `[1..500]`
16:31 <asonge> recursive function would be faster, technically. though i don't actually know which one right off the bat (there's a weird thing where tail-call recursive and body recursive functions can be very similarly fast)
16:31 <stephen_m> oh yea,
16:31 meh` joined
16:32 liz joined
16:32 <elixir1928> asonge: oh interesting. why would the recursive function be faster?
16:32 <stephen_m> 1..500 |> Enum.into([]) gives the list.
16:32 <asonge> it's basically how Enum.reduce is implemented in the end.
16:33 <elixir1928> stephen_m: yup, though asonge pointed out that ranges implement the Enum protocol so you can use them straight.
16:34 <asonge> the abstraction isn't free, it just doesn't matter most of the time. plus, writing recursive functions is often not as easily compositional (the logic for recursing is mixed with the logic for transformation, making switching abstractions harder)
16:34 <stephen_m> yea, true
16:34 <elixir1928> asonge: ah, gotcha
16:34 <elixir1928> I've actually got to run, but thanks again for the help. :)
16:34 <asonge> an Enum.reduce function can go into Stream.reduce and Flow.reduce...or anything else.
16:34 isubasti joined
16:34 <ejpcmac> stephen_m: Putting `config :timex, default_locale: "fr"` in config.exs works well
16:35 <stephen_m> is it not better to use UTC on the server?
16:35 <asonge> locale isn't the same as timezone...
16:36 <stephen_m> I'm not familiar with timex
16:36 <asonge> a locale is going to control the words that pop out of the datetime functions...
16:37 <ejpcmac> And a timezone the offset with UTC
16:37 <stephen_m> i see...
16:38 chriswarren joined
16:39 chriswar_ joined
16:39 duane joined
16:41 m_m joined
16:43 cemilowski left
16:44 icapurro joined
16:44 chrisml joined
16:48 jkreeftmeijer joined
16:50 WhiskyRyan joined
16:56 isubasti joined
16:58 mitchellhenke joined
17:07 am55 joined
17:16 isubasti joined
17:18 <Nicd-> hmmm: "warning: the :datetime type in migrations is deprecated, please use :utc_datetime or :naive_datetime instead"
17:18 <Nicd-> but neither of those are database types
17:20 <ejpcmac> Nicd-: They are Ecto types : https://hexdocs.pm/ecto/Ecto.Schema.html#module-types-and-casting
17:20 <Nicd-> yes, but in migration files, don't you give database types?
17:20 <ejpcmac> AFAIK, you put Ecto types in migrations, an Elixir types in Schemas
17:21 <Nicd-> like, in my schema I would have "field :sent_at_local, :naive_datetime" and in migration "add :sent_at_local, :datetime"
17:21 <ejpcmac> The Ecto types are converted to native database types by the adapters
17:22 <Nicd-> similarly I have "field :tz_offset, :integer" in my schema but "add :tz_offset, :smallint" in my migration
17:22 <Nicd-> and that's fine for ecto
17:27 dignifiedquire joined
17:37 isubasti joined
17:38 laut joined
17:39 chrisml joined
17:40 mk[] joined
17:40 <mk[]> are there any forum frameworks like Discourse for Elixir?
17:41 <molloy> mk[]: josh adams is working on rewriting discourse in elixir iirc
17:42 pHcF joined
17:43 chriswarren joined
17:43 <mk[]> molloy: found the kickstarter page
17:43 <mk[]> https://www.kickstarter.com/projects/1003377429/firestorm-an-open-source-forum-in-phoenix-from-eli
17:43 <molloy> yeah!
17:44 <molloy> i wrote a barebones discourse client for elixir
17:45 <mk[]> molloy: I've never used Discourse, but it seems better than a myriad of PHP forums
17:46 <molloy> https://github.com/mmcnellis/discourse_elixir
17:46 <molloy> it only has the functionality i need but tried to write it in a way where it'd be easily extendible
17:46 <molloy> wrapping HTTPoison.Base, which is a great lib
17:47 <molloy> yeah Discourse is great, we use it for the community part of our platform
17:47 <molloy> we use it just as an api and have our own frontend
17:48 <mk[]> REST?
17:49 m_m joined
17:50 <mk[]> it seems like for many forum and chat apps JSON-RPC over websockets makes more sense, as the server needs to send stuff ad-hoc
17:50 m_m joined
17:50 <Nicd-> discourse is long polling I believe
17:51 chriswarren joined
17:52 <molloy> discourse can serve json
17:52 <molloy> that's what we do
17:53 raycoll joined
17:53 <mk[]> yeah, but it probably has to do polling for notifications
17:53 MaSven joined
17:54 ngr joined
17:56 chuff joined
17:56 comboy joined
17:56 spl joined
17:58 isubasti joined
18:01 dmilith joined
18:02 MotherFlojo joined
18:02 chuff joined
18:03 icapurro joined
18:06 jmiven joined
18:07 griffinb_ joined
18:16 <zvrk>
18:17 jamescarr joined
18:19 isubasti joined
18:23 InternetFriend joined
18:25 shadowjack joined
18:25 wsieroci joined
18:31 MotherFlojo joined
18:33 refriedchicken joined
18:34 jerel joined
18:35 wsieroci joined
18:38 icanhazbroccoli joined
18:40 isubasti joined
18:41 nahtnam joined
18:41 benji joined
18:49 jkreeftmeijer joined
18:52 am55 joined
18:54 MaSven joined
18:57 hash joined
18:59 kyrix joined
19:01 isubasti joined
19:02 MaSven joined
19:08 griffinb_ joined
19:09 cemilowski joined
19:10 duane joined
19:10 hellofunk joined
19:22 isubasti joined
19:25 marcdel joined
19:40 dani0_ joined
19:42 isubasti joined
19:44 m_m joined
19:48 <nd__> I upgraded my phoenix app to 1.3-rc and now I get the following – did somebody experience the same and has a solution? https://gist.github.com/alappe/bc5011b1410c33e2898f9eebb0521b40
19:51 jkreeftmeijer joined
19:58 chriswarren joined
20:00 <hq1> hi, does anyone know what to replace folsom/folsomite with, to aggregate/send metrics to graphite? I'm running out of ETS :)
20:02 <micmus> hq1: there's a vm switch to have more tables
20:03 <hq1> I know, wondering if I could avoid that by getting a drop-in replacement
20:03 isubasti joined
20:05 Ven joined
20:08 duane joined
20:09 griffinb_ joined
20:10 vmoravec joined
20:21 marcdel joined
20:21 chriswarren joined
20:24 jamescarr joined
20:24 isubasti joined
20:27 <cevado> Does anyone know if there is a way to dinamicaly define pattern matching on function call? I'm building a behavior to reduce repeated code.
20:29 <benwilson512> cevado: you can use macros for that purpose
20:29 kau joined
20:31 <benwilson512> https://www.irccloud.com/pastebin/KQcfWdY8/
20:31 <benwilson512> by way of example ^
20:33 <cevado> thanks benwilson512, i'm trying that actually using the enum.map
20:33 <benwilson512> both should work yea
20:34 <cevado> i was worried that it wouldn't work
20:39 cdg joined
20:44 <benwilson512> You should check out the meta-programming elixir bok
20:45 isubasti joined
20:47 io_bora joined
20:48 MotherFlojo joined
20:53 duane joined
20:56 marcdel joined
20:56 aeliton joined
21:00 <aeliton> hi all, I'd like to know if what's the recommended way to make Logger outputs to a file on a phoenix application that uses Exrm to run in production?
21:01 jkreeftmeijer joined
21:01 icapurro joined
21:06 isubasti joined
21:10 griffinb_ joined
21:19 MotherFlojo joined
21:22 dpritchett joined
21:27 isubasti joined
21:40 jamescarr joined
21:48 isubasti joined
21:59 WhiskyRyan joined
22:02 jkreeftmeijer joined
22:07 isubasti joined
22:08 cemilowski joined
22:13 aidalgol joined
22:24 aeliton joined
22:28 isubasti joined
22:29 cemilowski left
22:33 icapurro joined
22:34 icapurro joined
22:41 griffinb_ joined
22:48 raycoll joined
22:48 isubasti joined
22:52 InternetFriend joined
22:53 jamescarr joined
22:54 <cevado> is it possible to call a function from other module in a macro expansion?
22:55 ejpcmac left
23:00 <cevado> i tried it here but it says the function doesnt exist... Code.ensure_compiled/1 can help or its just impossible?
23:04 jkreeftmeijer joined
23:09 gvaughn joined
23:09 isubasti joined
23:18 gvaughn_ joined
23:19 <ciawal> cevado: sure it is
23:24 <cevado> ciawal i want to call it inside the macro but outside the code injection. it should be resolved in compilation time, not in runtime.
23:27 <ciawal> gist your code
23:27 <cevado> just a min
23:27 hunterboerner joined
23:30 isubasti joined
23:35 <cevado> ciawal take a look https://gist.github.com/fcevado/1ffa9451427b9a6a222534d730c6863e
23:38 chavito joined
23:51 isubasti joined
23:55 jamescarr joined