<    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 24 25  
26 27 28 29 30 31
00:01 vendethiel- joined
00:01 PaReeOhNos joined
00:05 zabirauf joined
00:06 wwwd joined
00:08 <wwwd> Does anyone know, is there any place in the docs that it tells what type of html tag will be generated when a specific type is give as input to the phoenix.gen.html command?
00:12 SvenMa joined
00:15 vendethiel joined
00:17 rschmukler joined
00:19 codestorm joined
00:21 zabirauf joined
00:24 raycoll joined
00:24 griffinbyatt joined
00:26 sfbw joined
00:28 chriswarren joined
00:30 johnstorey joined
00:47 Cohedrin joined
00:49 codestorm joined
00:52 nahtnam joined
01:09 chriswarren joined
01:12 chriswarren joined
01:15 PaReeOhNos joined
01:18 chriswarren joined
01:21 steffkes joined
01:21 steffkes joined
01:30 rschmukler joined
01:30 jkreeftmeijer joined
01:30 griffinbyatt joined
01:39 tomterl joined
01:41 stnly joined
01:44 codestorm joined
01:44 s`_ joined
01:50 chriswarren joined
01:57 griffinbyatt joined
02:19 justicefries left
02:20 codestorm joined
02:20 rschmukler joined
02:22 exadeci joined
02:23 Guest___ joined
02:27 raycoll joined
02:29 PaReeOhNos joined
02:31 jkreeftmeijer joined
02:35 rschmukler joined
02:44 rschmukler joined
02:54 rschmukler joined
03:07 Ioyrie joined
03:11 rschmukler joined
03:13 chriswarren joined
03:13 jbranchaud joined
03:14 chriswarren joined
03:14 chriswarren joined
03:15 chriswarren joined
03:16 chriswarren joined
03:17 chriswarren joined
03:18 chriswarren joined
03:18 chriswarren joined
03:21 steffkes joined
03:21 steffkes joined
03:23 Ioyrie joined
03:24 wtetzner joined
03:36 sfbw joined
03:38 rschmukler joined
03:41 jbranchaud joined
03:44 PaReeOhNos joined
03:49 Guest70524 joined
03:50 stnly joined
03:53 Blkt joined
04:02 sivsushruth joined
04:03 <sivsushruth> Is there a way to start node as a hidden node without using command line args
04:03 <sivsushruth> ?
04:08 <asonge> sivsushruth: it's an application setting on the :kernel app, so you can use the config to set the hidden setting (i think you have to do this before the app is started, which config.exs will do)
04:11 racycle joined
04:11 rschmukler joined
04:11 <asonge> oh, there's a :net_kernel.hidden_connect_node() function
04:12 <asonge> erm, :net_kernel.hidden_connect()*
04:13 MaSven joined
04:14 <sivsushruth> trying, one sec
04:14 <sivsushruth> thanks
04:16 rschmukler joined
04:25 matt___ joined
04:26 <matt___> Hi everyone! I'm a beginner in Elixir, and I'm currently coding a simple module that uses GenServer and ETS to store information, but I have a few questions to make sure that I understand well its behavior, may I ask?
04:30 <alisdair> go for it
04:30 <pandamatt> Thanks. Here are my questions:
04:30 <pandamatt> - A GenServer may run on multiple CPUs, but it can only process one message (be it cast or call) at a time, right?
04:30 <pandamatt> - The data I store in my ETS table is not too complex, but it's complex enough that I can't use update_element to update it. I need to read and write data in an atomic, transactional way, but ETS doesn't provide any way of doing a read then a write in one transaction, right?
04:31 <pandamatt> - Since GenServer can only process one message at a time and it's the owner of the ETS table I'm using, then since only it can write to the table, it means that if I keep the read + update operation that I wish to be transactional in the same handle_call function, it'll indeed be like a transaction, that is, there is no risk of the data to be accessed in the meantime, correct?
04:31 <asonge> a gen_server process is only run by 1 cpu at a time. it might jump on any particular scheduler on any particular CPU.
04:31 <asonge> (all erlang processes run on 1 cpu at a time)
04:31 <alisdair> if you only start a single instance of your GenServer it will process messages sequentially, yes
04:31 <alisdair> you can start multiple instances however, but they will each have their own state
04:33 jkreeftmeijer joined
04:33 <asonge> and to answer the atomicity question, this mostly matters if you're reading outside of the process while writing inside, and issuing multiple related writes. you can update an entire row at once, and if you read, update in-process, then write, the write will be atomic for that 1 value.
04:34 pandamatt joined
04:34 <asonge> so, in case you didn't get my last message:
04:34 <asonge> and to answer the atomicity question, this mostly matters if you're reading outside of the process while writing inside, and issuing multiple related writes. you can update an entire row at once, and if you read, update in-process, then write, the write will be atomic for that 1 value.
04:35 zabirauf joined
04:36 <asonge> pandamatt: a lot of this is covered in this very recent talk from erlang and elixir factory from thursday, https://www.youtube.com/watch?v=D3IftRUQgqc
04:36 <pandamatt> ok, thanks! I only intend to read and write from that gen server process (using private when creating the table), so that should be fine
04:36 <pandamatt> thanks a lot! I'll check this video
04:36 <asonge> (it goes through agent, and then ets+gen_server, then other variants of ets+gen_server, depending on what you need)
04:38 pandamatt joined
04:39 pandamatt joined
04:47 raycoll joined
04:47 rschmukler joined
04:49 chriswarren joined
04:50 chriswar_ joined
04:53 gvaughn joined
04:54 rschmukler joined
04:57 chriswarren joined
04:58 chriswarren joined
04:58 PaReeOhNos joined
04:58 chriswarren joined
04:59 chriswarren joined
05:13 griffinbyatt joined
05:15 rschmukler joined
05:20 rschmukler joined
05:22 steffkes joined
05:24 dani0_ joined
05:29 meandi_2 joined
05:37 markh joined
05:43 chriswarren joined
05:55 cemilowski joined
06:01 chriswarren joined
06:11 PaReeOhNos joined
06:11 cemilowski joined
06:17 cemilowski left
06:20 raycoll joined
06:20 chriswarren joined
06:34 jkreeftmeijer joined
06:35 nahtnam joined
06:35 <nahtnam> Hey
06:35 <nahtnam> Im having a weird issue with phoenix
06:35 <nahtnam> in the settings, I set debug_errors: to false
06:35 hahuang65 joined
06:36 <nahtnam> so when I go to a 404 page, I get json instead of the debug page
06:36 <nahtnam> but when i make an xhr request from my spa, I dont get an response other than 404
06:36 <nahtnam> I.e. I dont get any json data in the response
06:38 chriswarren joined
06:40 zabirauf joined
06:40 <asonge> nahtnam: what are you setting as an Accept header?
06:40 marcdel joined
06:40 <asonge> (in the client)
06:40 <nahtnam> Accept:application/json, text/plain, */*
06:41 <nahtnam> content-type:application/json; charset=utf-8
06:41 <nahtnam> ^ response
06:42 gvaughn joined
06:43 <nahtnam> render_errors: [view: Ludicrous.Web.ErrorView, accepts: ~w(json)],
06:44 tuacker joined
06:44 <nahtnam> Thats in my config.exs
06:44 cemilowski joined
06:47 chriswarren joined
06:50 marcdel joined
06:52 <hahuang65> is there an easy way in ExUnit to assert that Logger was logged to?
06:59 <hahuang65> ExUnit.CaptureLog ^_^
07:05 chriswarren joined
07:13 marcdel_ joined
07:22 PaReeOhNos joined
07:23 steffkes joined
07:24 luke_nukem joined
07:33 chriswarren joined
07:48 nd__ joined
07:49 josevalim joined
07:50 tuacker1 joined
07:51 dani0_ joined
07:51 chriswarren joined
07:55 voltone joined
07:58 jkreeftmeijer joined
08:01 chriswarren joined
08:09 voltone joined
08:10 hekmatof joined
08:16 griffinbyatt joined
08:18 zabirauf joined
08:19 chriswarren joined
08:20 nighty-_ joined
08:24 jdrab joined
08:27 cemilowski joined
08:27 stephen_m joined
08:28 chriswarren joined
08:31 gvaughn joined
08:35 PaReeOhNos joined
08:37 chriswarren joined
08:55 chriswarren joined
09:08 squallstter joined
09:13 chriswarren joined
09:14 bungoman joined
09:14 jkreeftmeijer joined
09:22 wsieroci joined
09:24 steffkes joined
09:29 killtheliterate joined
09:32 chriswarren joined
09:36 steffkes joined
09:36 steffkes joined
09:37 manjaroi3 joined
09:43 PaReeOhNos joined
09:46 cemilowski joined
09:50 chriswarren joined
09:54 dani0_ joined
09:57 gokr joined
10:04 gmcabrita joined
10:15 lexmag joined
10:16 griffinbyatt joined
10:19 dani0_ joined
10:29 chriswarren joined
10:34 minijackson joined
10:41 PaReeOhNos joined
10:41 MaSven joined
10:48 jkreeftmeijer joined
10:51 wsieroci joined
11:00 Guest67_ joined
11:06 minijackson left
11:06 chriswarren joined
11:11 Benjojo joined
11:36 cemilowski left
11:42 manjaroi3 joined
11:49 jkreeftmeijer joined
11:57 Or1on joined
12:06 griffinbyatt joined
12:21 chriswarren joined
12:24 Guest67_ joined
12:25 Or1on joined
12:37 chriswarren joined
12:38 rschmukler joined
12:45 dani0_ joined
12:52 tuacker joined
12:55 chriswarren joined
13:07 dastagg joined
13:10 rschmukler joined
13:14 wsieroci_ joined
13:15 rschmukler joined
13:17 killtheliterate joined
13:20 Gasher joined
13:20 steffkes joined
13:20 steffkes joined
13:22 griffinbyatt joined
13:23 rokf joined
13:31 travis-ci joined
13:31 <travis-ci> elixir-lang/elixir#14089 (master - 24872d9 : evuez): The build passed.
13:31 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/d020b187a5ac...24872d9e4508
13:31 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/215209337
13:31 travis-ci left
13:32 travis-ci joined
13:32 <travis-ci> elixir-lang/elixir#14090 (master - e7db5d8 : Aleksei Magusev): The build passed.
13:32 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/24872d9e4508...e7db5d81c4cd
13:32 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/215209547
13:32 travis-ci left
13:33 Guest67_ joined
13:34 chriswarren joined
13:37 ardhitama joined
13:41 chriswarren joined
13:49 griffinbyatt joined
13:52 jkreeftmeijer joined
13:53 craigp joined
13:55 dimitarvp joined
13:57 Guest67_ joined
14:00 <Gasher> Hello, I saw the following expression: new_map = %{ map | a: 25} and I have a question - is the | used exclusively for updating a map, or is it some kind of universal operator?
14:00 <craigp> Gasher: only maps afaik
14:00 <Gasher> thanks
14:00 <craigp> but it will not add keys to a map, only update existing keys
14:02 Guest67_ joined
14:04 <ciawal> it's also used for list prepends
14:06 Ven joined
14:09 wsieroci joined
14:10 <Gasher> what about compiling to bytecode? when using elixirc, I get no new files
14:14 <Gasher> compiling normal files, not just modules
14:14 <micmus> only modules can be compiled
14:15 rschmukler joined
14:18 chriswarren joined
14:19 <Gasher> oh, no other way to do it? is it the same with Erlang?
14:21 <micmus> yes, the compiled artifact - .beam file represents a single module
14:25 jhack joined
14:25 jhack joined
14:27 chriswarren joined
14:28 <johnhamelink> Hey guys. I have a GenServer which has a Process.send_after() loop in it to batch up API requests periodically, call them, handle the result and then run Process.send_after() again. I'm trying to figure out how best to write a test for this functionality?
14:30 dani0_ joined
14:31 Ven_ joined
14:32 wsieroci joined
14:35 duytruong joined
14:37 duytruong left
14:37 chriswarren joined
14:45 MarioBranco joined
14:45 jdrab joined
14:47 rschmukler joined
14:47 josevalim joined
14:48 chriswarren joined
14:48 webdev007 joined
14:50 gvaughn joined
14:51 ardhitama_ joined
14:51 nomicflux joined
14:52 wtetzner joined
14:53 jkreeftmeijer joined
15:03 gvaughn joined
15:05 lexmag joined
15:07 rschmukler joined
15:10 greengriminal joined
15:12 marcdel joined
15:14 chriswarren joined
15:20 Ven joined
15:21 steffkes joined
15:21 steffkes joined
15:23 marcdel joined
15:23 dani0_ joined
15:23 chriswarren joined
15:25 rschmukler joined
15:26 meh` joined
15:28 craigp joined
15:44 rschmukler joined
15:51 racycle joined
15:51 chriswarren joined
15:57 wsieroci joined
16:01 chriswarren joined
16:12 jdrab joined
16:22 jhack joined
16:30 jdrab joined
16:37 travis-ci joined
16:38 <travis-ci> elixir-lang/elixir#14091 (master - 9711c6f : Eksperimental): The build passed.
16:38 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/e7db5d81c4cd...9711c6ff3a3a
16:38 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/215249183
16:38 travis-ci left
16:38 chriswarren joined
16:47 rschmukler joined
16:55 jkreeftmeijer joined
17:04 chriswarren joined
17:06 raycoll joined
17:06 Or1on joined
17:11 jbranchaud joined
17:11 fernandomm joined
17:12 DLSteve joined
17:13 DLSteve joined
17:14 Cohedrin joined
17:19 cemilowski joined
17:21 steffkes joined
17:21 steffkes joined
17:22 chriswarren joined
17:32 codestorm777 joined
17:32 chriswarren joined
17:41 greengriminal joined
17:42 marcdel joined
17:50 chriswarren joined
17:52 vmoravec joined
17:57 wsieroci joined
18:08 chriswarren joined
18:10 <drewolson> is there a magic trick that i need to make plug.test work with ecto in sandbox mode?
18:11 <drewolson> should i just use :shared mode?
18:15 <drewolson> (that seems to work, manual mode doesn't because my router is spawned by my application, i think? i'm not sure actually)
18:16 jerel joined
18:17 johnstorey joined
18:27 jbranchaud joined
18:29 rschmukler joined
18:42 arthurcolle joined
18:42 steffkes joined
18:42 steffkes joined
18:46 jegade joined
18:47 chriswarren joined
18:47 goldpank joined
18:49 m_m joined
18:49 raycoll joined
18:49 montanonic joined
18:53 <benwilson512> what are you trying to do, a regular integration style test?
18:53 <benwilson512> you should be able to just use the regular mode and check out a connection
18:53 <benwilson512> assuming that you yourself are not spawning any processes inside the action
18:57 jkreeftmeijer joined
18:59 Guest__ joined
19:03 <fishcakez> drewolson: if you get confused by sandbox ownership try `ownership_log: :warn` in repo config
19:03 <fishcakez> We also have important bug fix in latest dbconnection
19:04 <fishcakez> (for sandbox)
19:11 <fishcakez> ^likely only effects preloads
19:13 dani0_ joined
19:22 Uniaika joined
19:22 chriswarren joined
19:24 nd__ joined
19:25 gazler_ joined
19:31 <josevalim> benwilson512:
19:32 chriswarren joined
19:32 digiorgi joined
19:32 <digiorgi> how can i create a zip of a folder with :zip.create ?
19:32 <digiorgi> is just keep returning {:error, :einval}
19:33 <josevalim> i don't think so. you need to get all of the contents of the folder
19:33 <josevalim> you can't just pass a folder
19:37 gvaughn joined
19:38 am55 joined
19:41 chriswarren joined
19:46 zabirauf joined
19:48 <digiorgi> josevalim, lol yes! xd
19:48 <digiorgi> thanks
19:49 raycoll joined
19:51 wtetzner joined
19:52 am55 joined
19:52 wsieroci joined
19:53 wsieroci_ joined
19:55 MotherFlojo joined
19:59 chriswarren joined
19:59 kyrix joined
20:01 jbranchaud joined
20:05 apotry joined
20:11 raycoll_ joined
20:17 chriswarren joined
20:24 steffkes joined
20:24 steffkes joined
20:27 MotherFlojo joined
20:30 jbranchaud joined
20:35 chriswarren joined
20:39 pcre joined
20:47 gazler_ joined
20:48 MotherFlojo joined
20:48 elxris joined
20:53 wsieroci joined
20:54 Sionide22 joined
20:55 MonononcQc joined
20:56 jerel joined
20:56 josevalim joined
20:58 jkreeftmeijer joined
21:00 jasmo2 joined
21:13 Ioyrie joined
21:15 chriswarren joined
21:16 dannluciano joined
21:21 raycoll joined
21:29 Stratus3D joined
21:34 gokr joined
21:38 <drewolson> benwilson512: the tests for this project were failing if i had it in manual mode and did a checkout with the repo in the setup
21:38 <drewolson> https://gitlab.com/drewolson/graphql_example_elixir
21:38 <drewolson> adding https://gitlab.com/drewolson/graphql_example_elixir/blob/master/test/blog/web/router_test.exs#L9 seemed to fix it
21:39 <drewolson> but i was confused why i needed it in the first place
21:39 <drewolson> benwilson512: the project uses absinthe if that makes you any more interested :)
21:55 gazler_ joined
21:57 MotherFlojo joined
21:58 chriswarren joined
22:09 rschmukler joined
22:10 BeerLover joined
22:11 <BeerLover> is Ecto.Changeset a struct?
22:14 <fishcakez> drewolson: should work fine with manual
22:16 chriswarren joined
22:16 <asonge> BeerLover: yes
22:17 <BeerLover> asonge then why is it diplayed differently?
22:17 <BeerLover> in iex
22:17 rschmukler joined
22:17 <BeerLover> a normal struct that i create is displayed as %Topic
22:17 <BeerLover> but changeset is displayed with a #
22:17 <asonge> structs can control how they show up under inspect
22:18 <BeerLover> how?
22:18 <asonge> this is good for hiding stuff that is internal stuff that should be opaque and only controlled via API
22:18 <asonge> Inspect has a protocol
22:22 rschmukler joined
22:26 chriswarren joined
22:26 steffkes joined
22:26 steffkes joined
22:30 dimitarvp joined
22:31 rschmukler joined
22:31 <fishcakez> drewolson: can you run that test only with ownership_log: :warn and manual?
22:31 m_m joined
22:31 <fishcakez> Or :error if need higher lvl
22:32 PaReeOhNos joined
22:35 <fishcakez> It seems like bug in sandbox
22:37 MononcQc joined
22:41 kau joined
22:41 <alisdair> can i attach metadata to an ecto query (for use in ecto.logger?)
22:44 chriswarren joined
22:48 <fishcakez> alisdair: only if you put in pdict
22:48 <fishcakez> Or custom logger
22:49 <alisdair> ecto is really frustrating :(
22:50 <alisdair> there doesn't seem to be anyway to force the sbroker pool without forking either
22:51 <fishcakez> Wdym force?
22:51 <alisdair> the postgres adapter overwrites the pool option even if you pass in DBConnection.Sbroker
22:51 <alisdair> https://github.com/elixir-ecto/ecto/blob/master/lib/ecto/adapters/postgres.ex#L218
22:52 <fishcakez> Overwrites?
22:52 <fishcakez> That's on purpose to run single process
22:52 <fishcakez> It's only for create and drop
22:54 <alisdair> oh ok
22:54 <alisdair> i thought it was used for raw sql queries too
22:59 bcinman joined
23:01 smt joined
23:02 chriswarren joined
23:03 <bcinman> is it a good idea to use ETF is a binary protocol to communicate with untrusted clients?
23:10 <cmk_zzz> bcinman: you can use binary_to_term(Bin, [safe]) which is according to documenentation should be used when receiving binaries from untrusted sources
23:10 wtetzner joined
23:10 <cmk_zzz> under the assumption ETF = erlang term format in serialized binary format (term_to_binary)
23:10 <bcinman> yep thats what i meant
23:12 <bcinman> cmk_zzz: thanks, i think i'll do that
23:14 rschmukler joined
23:24 montanonic joined
23:32 meh` joined
23:33 mk[] joined
23:34 <asonge> bcinman cmk_zzz: safe doesn't act *quite* like you think it might. it's still pretty dangerous to use with an untrusted client. safe only guarantees that you won't generate *new* functions, but you can generate a reference to a real function, and that works.
23:35 <mk[]> how can I make worker processes (for Supervisor) talk to each other?
23:35 <asonge> mk[]: give them a name. use the name.
23:35 <asonge> there are other strategies, but most gen_servers are a kind of "singleton" process with a name
23:36 <asonge> or completely anonymous
23:36 <asonge> (for the in-between stuff, Elixir intorduced Registry, which is nice)
23:36 <bcinman> asonge: ah gotcha, might be better to use something like protobuf then
23:37 <mk[]> asonge: so pass a name to genserver's start_link?
23:37 <asonge> bcinman: protobuf is better because it does define an actual protocol, and is probably a bit more portable.
23:37 <asonge> mk[]: yeah, you can do that.
23:37 <asonge> mk[]: their order in the supervisor will be the order in which the supervisor starts the children
23:38 <mk[]> asonge: how can I call a genserver process by name? GenServer.call requires a pid
23:38 <asonge> takes a name
23:38 <mk[]> oh, nice, let me look into it
23:40 <asonge> mk[]: when you see the argument, you might want to use the @spec part more than the name in the function docs (use `s <function>` in iex to get the spec, `t Module.typename` to get the type definition, if a primitive isn't used in the spec)
23:41 chriswarren joined
23:45 <cmk_zzz> asonge: what do you mean pretty dangerous? What problems might I encounter?
23:46 <asonge> cmk_zzz: so, if you just execute a function that you grab of :binary_to_term with :safe, the safe part is just about the function *reference*, so someone could construct a function reference to shut down the VM
23:46 <asonge> (or *anything*)
23:46 <asonge> it's just that you're not allowed to define *new* functions
23:47 <cmk_zzz> asonge: what is a functional reference in this case?
23:47 <asonge> (you could walk over the entire term and filter this stuff out, but you can't really be naive about it)
23:48 <cmk_zzz> sorry for being daft, I should know this
23:48 <asonge> cmk_zzz: i think &:init.stop/0 would be sufficient?
23:49 <asonge> yeah, just tested it.
23:49 <asonge> cmk_zzz: :erlang.binary_to_term(<<131, 113, 100, 0, 4, 105, 110, 105, 116, 100, 0, 4, 115, 116, 111, 112, 97, 0>>, [:safe])
23:51 <asonge> it's "safe" from creating new code, and you'd still need to execute an arbitrary function reference from the deserialized term to actually be a security issue, but it's there.
23:51 <cmk_zzz> asonge: I see.
23:52 <cmk_zzz> I wonder if BERT has the same problem
23:52 <asonge> it doesn't
23:57 chriswarren joined