<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 25 26 27  
28 29 30 31
00:05 praveen joined
00:07 <notriddle> I can't guess any more than that, sorry.
00:11 hakunin joined
00:14 PaReeOhN_ joined
00:15 griffinbyatt joined
00:19 sp4rrow joined
00:20 lbotos__ joined
00:20 HashNuke joined
00:20 termos joined
00:21 PaReeOhNos joined
00:21 gmcintire joined
00:24 icecreamcohen joined
00:31 bitmod joined
00:34 zodiak__ joined
00:38 wpcarro joined
00:41 ssswitch joined
00:43 zodiak_ joined
00:43 <meh`> halp
00:44 <meh`> I'm having issues with UUID as ids in ecto
00:44 <meh`> Repo.get doesn't work
00:44 <meh`> I found a related question somewhere that says to add @foreign_key_type Ecto.UUID
00:44 <meh`> but that still doesn't fix it
00:45 <meh`> do I need to do anything else?
00:54 jkreeftmeijer joined
00:54 mika_ joined
00:58 gem joined
01:05 dimitarvp` joined
01:06 petejkim joined
01:09 refriedchicken66 joined
01:14 <thurloat[m]> nhu: I'm not seeing a fetch_params in the docs, I do see https://hexdocs.pm/plug/Plug.Conn.html#fetch_query_params/2 . params should be a field on the conn after you've fetched them.
01:21 hakunin joined
01:22 cschneid_ joined
01:26 wong2 joined
01:27 wpcarro joined
01:31 zodiak joined
01:36 whharris joined
01:37 hakunin joined
01:37 griffinbyatt joined
01:37 hakunin joined
01:38 the_voice- joined
01:39 tomterl joined
01:41 sp4rrow joined
01:44 wpcarro joined
01:48 cschneid_ joined
01:49 gem joined
01:57 sevenseacat joined
01:59 steffkes joined
01:59 steffkes joined
02:01 balena joined
02:08 wpcarro joined
02:10 fhoffmann joined
02:11 balena left
02:17 sp4rrow joined
02:21 wpcarro joined
02:24 nomicflux joined
02:28 Andrevan joined
02:36 wpcarro joined
02:38 wong2 joined
02:39 Liquid_X joined
02:39 griffinbyatt joined
02:55 jkreeftmeijer joined
02:57 hakunin joined
03:01 baweaver joined
03:04 adamkittelson_ joined
03:05 raymorgan_ joined
03:05 avdi_ joined
03:05 gregn joined
03:06 vadviktor joined
03:06 msantos_ joined
03:06 Liquid_X_ joined
03:06 ec\_ joined
03:07 ssswitch joined
03:08 Cthalupa- joined
03:08 sp4rrow joined
03:09 cmn joined
03:09 whharris_ joined
03:09 mika_ joined
03:09 watersoul_ joined
03:09 wpcarro joined
03:12 fhoffmann joined
03:12 SouvikB joined
03:12 dbarrett joined
03:12 dbarrett joined
03:13 a^ joined
03:13 wong2 joined
03:14 meh` joined
03:15 vadviktor joined
03:15 der_graf joined
03:15 rschmukler joined
03:18 Lykve joined
03:19 jmiven joined
03:20 Andrevan joined
03:23 sfbw joined
03:24 petejkim joined
03:35 jerel joined
03:35 petejkim joined
03:45 wpcarro joined
03:50 justelex_ joined
03:56 dj_goku joined
04:00 steffkes joined
04:00 steffkes joined
04:06 magicstapler joined
04:06 <magicstapler> So, I'm running into a problem understanding GenServers and Agents.
04:06 <magicstapler> Regarding: http://elixir-lang.org/getting-started/mix-otp/genserver.html
04:07 <magicstapler> GenServer.start_link(__MODULE__, :ok, [])
04:07 <magicstapler> This lines results in a call to init(:ok)
04:07 <magicstapler> Which returns {:ok, %{}}
04:07 <magicstapler> Then you have: def handle_call({:lookup, name}, _from, names) do
04:07 <magicstapler> Which returns: {:reply, Map.fetch(names, name), names}
04:08 <magicstapler> I don't understand... How does Map refer to the map literal defined in init(:ok)?
04:08 <magicstapler> Does state, which is in this case %{} have to be a data structure?
04:08 paidhi joined
04:09 elgenie joined
04:10 paidhi left
04:16 mika_ joined
04:17 site_is_down joined
04:19 Ioyrie joined
04:24 refriedchicken66 joined
04:38 gem joined
04:41 griffinbyatt joined
04:43 petejkim joined
04:46 akeating joined
04:49 rkazak joined
04:53 hakunin joined
04:54 <Nicd-_> magicstapler: on the last line you posted Map is operating on the variable names
04:55 <Nicd-_> state can be any Erlang term, it is passed as the last argument to handle_call (here named "names")
04:57 <magicstapler> Hmm... I suppose I'm confused on how state is stored in GenServer. It's all very opaque magical.
04:58 <Nicd-_> you return the state at the end of a handling function (or init) and it is passed to the next call automatically
04:58 jkreeftmeijer joined
04:58 <magicstapler> Nicd-_: So, is the first arg to Map.fetch/1 the pid of the map literal?
04:59 <Nicd-> no, it's a map in the variable 'names'
04:59 <Nicd-> it's also Map.fetch/2
04:59 <magicstapler> Nicd-: Right, sorry /2
05:00 <magicstapler> Nicd-: Wait, so the all the variables in the init() block are accessible from any of the methods defined?
05:00 <Nicd-> no
05:00 <Nicd-> init returns {:ok, state}
05:00 <Nicd-> in this case state is %{}
05:00 <magicstapler> Nicd-: right.
05:00 <Nicd-> that state is passed into the next callback automatically as the last argument
05:01 <Nicd-> each callback will alter the state and return it back at the end of the function
05:01 <Nicd-> then it is passed again to the next callback
05:01 <magicstapler> Nicd-: Whoa, so it's just magically added as the last arg?
05:02 <Nicd-> so in 'handle_call({:lookup, name}, _from, names)', the last argument 'names' will be the current stored state of the genserver
05:02 <Nicd-> well GenServer is an abstraction that you are using, it's not really magic :P but you don't have to do it yourself
05:02 <magicstapler> Nicd-: So GenServer.call(server, {:lookup, name}) gets transformed into that handle_call?
05:03 <Nicd-> no, it will send a message to that genserver process which will receive it and call handle_call
05:03 <magicstapler> Ohh........
05:03 <asonge> it doesn't get transformed. GenServer is a kind of "framework" that controls a lot of the flow. it does all the "receive" stuff for you in the process, and the client api wraps all the messages
05:05 refriedchicken66 joined
05:05 dec0n joined
05:05 <asonge> like, when you make a genserver call, the module will set up all sorts of shit, like set up a "monitor" and listen for server shutdown while your "call" is in flight
05:07 <magicstapler> Hmm...
05:07 <magicstapler> I can usually pick up languages no problem, but Elixir is a different beast entirely.
05:08 <magicstapler> I've followed through the getting started guide, but still haven't grokked it yet.
05:08 <asonge> did you write your own server process yet that wasn't gen_server?
05:08 <magicstapler> Is there a place that talks through things like GenServer more?
05:08 <Nicd-> genserver is like a web framework. it offers you the functions to implement and saves you from writing the repetitive generic code
05:08 <Nicd-> so in that way it has "magic" but not a lot of it once you understand it
05:08 <asonge> otp can take a little time to get your mind around, but it's actually not that much magic. it's just different than what you're used to.
05:09 <asonge> but there's a few good books that describe it pretty well
05:09 <asonge> magicstapler: but if you wrote your own "server" process before, do you remember recursing around a receive block?
05:09 <magicstapler> asonge: I did the gen_tcp thing which was part os kv_server
05:10 <magicstapler> You mean the receive do block?
05:10 <asonge> yeah
05:10 <magicstapler> Yeah, the tail optimized recursion thing.
05:10 <magicstapler> That makes sense.
05:10 <magicstapler> A basic event loop, sorta.
05:10 <asonge> so, gen_server does the receive block itself, and it gives you a standard set of callbacks for common ways of doing things
05:11 <asonge> a "call" is a synchronous message, where you send some data and wait for a reply. the server side of a call takes the previous state, and then you return the reply (what to send) and the next state. a cast is an asynchronous message, and you return the next state.
05:12 <asonge> get it?
05:12 lbotos__ joined
05:12 justelex_ joined
05:12 pmonson joined
05:12 <asonge> init is an opportunity to "block" the GenServer start call while you set things up. this can definitely help you fight race conditions
05:13 zpconn__________ joined
05:13 termos joined
05:13 smeevil joined
05:13 <asonge> init takes an initial set of arguments that you passed in the start call, and it returns the starting state of the genserver
05:13 <asonge> but this is all about genserver managing a standard kind of process "lifecycle"
05:14 <magicstapler> ...thinking...
05:14 <asonge> so like, one thing that's more complicated, is that it provides hooks into "state transitions" between module versions on "hot code upgrades"...
05:15 <magicstapler> asonge: I'm a huge fan of the hot code reloading, but I don't fully understand it yet.
05:15 <asonge> if you were doing this all yourself, you'd have to sit there and write a receive do ... end block that's like 90% the same.
05:15 <magicstapler> I've been reading into the BEAM internals.
05:16 <magicstapler> Hmm... How does GenServer keep the state? I suppose it's similar to the processes with receive blocks, they just store it as a variable?
05:16 rschmukler joined
05:16 <asonge> magicstapler: here's the important bits of almost all of OTP, btw: https://github.com/erlang/otp/blob/master/lib/stdlib/src/gen.erl
05:16 petejkim joined
05:16 <asonge> so, when genserver starts, it invokes your module's callback functions. that's how it knows its state is there. it has the receive block.
05:18 <asonge> that's why Nicd- called it a framework above. rails controls the http lifecycle and methods are invoked on clases/objects when things happen. genservers start with a callback module that just returns the specific behavior, and it handles the general bookkeeping.
05:18 <magicstapler> This makes more sense.
05:20 <magicstapler> asonge: Thanks for the explanations. I have a second problem.
05:20 <asonge> go ahead
05:20 <magicstapler> I'm doing a # mix run and the app dies, do I need to call it with --no-halt?
05:21 <asonge> i think so? i almost always use `iex -S mix` myself.
05:21 <magicstapler> That seems dirty to start it like that for production.
05:21 <asonge> oh, for production you don't use mix
05:22 <asonge> you use a release
05:22 <magicstapler> Ok, but for development, I just use --no-halt?
05:22 <asonge> distillery is what you should be using when you want to deploy to production. it'll give you a tarball.
05:22 <magicstapler> Ok, I'll read up on that.
05:23 <asonge> you should be able to use that (you can also use releases in development, dev releases will leverage symlinks so that you can reload quickly without redoing the entire release)
05:23 <asonge> i don't tend to use dev releases.
05:24 sfbw joined
05:25 <magicstapler> Ah: " The reason for this is that by default mix run will exit once that callback has finished executing. In order for that not to happen you need to use mix run --no-halt - in this case the VM will not be stopped."
05:25 <magicstapler> I don't understand why that is the case, tho.
05:26 <magicstapler> asonge: One more issue, if you're game.
05:26 <asonge> shoot
05:27 <magicstapler> I'm trying to use https://github.com/MyMedsAndMe/spell/blob/master/lib/spell.ex
05:27 <asonge> oh, if you monitor some long-lived process and then monitor it and then receive the down message, you could "hang" the main process while waiting for the process to finish.
05:27 <magicstapler> I have GenServer.start_link(__MODULE__, {exchange_name, uri}, name: exchange_name) in my Worker.start_link()
05:27 <asonge> like, if you *needed* that.
05:28 <magicstapler> I'm not doing Process.monitor yet.
05:28 <magicstapler> Do I need to?
05:28 <asonge> no, i'm just saying, if you wanted mix run to "wait" for something to be complete before exiting.
05:28 <magicstapler> Ah.
05:29 <magicstapler> I'm calling it via the application supervisor generated code like this: worker(Ingestory.Worker, [{:poloniex, "asdf"}])
05:30 gokr joined
05:30 <magicstapler> lemme put this in pastebin
05:31 <asonge> so earlier, you said you passed a tuple, but in the later one, you're passing a list of 1 tuple
05:31 <asonge> just wanted to point that out
05:31 <magicstapler> https://pastebin.com/6z9DXjH4
05:32 <magicstapler> # Starts a worker by calling: Ingestory.Worker.start_link(arg1, arg2, arg3)
05:32 <magicstapler> That takes care of the arg transformation
05:32 <asonge> so what's the problem, exactly?
05:33 <magicstapler> So the problem I'm having is that sometimes I'm getting {:error, timeout} but it eventually connects.
05:33 <magicstapler> It seems like a race condition.
05:33 <magicstapler> so I'm not getting the pid of the successful connection.
05:34 <magicstapler> ** (Mix) Could not start application ingestory: Ingestory.Application.start(:normal, []) returned an error: shutdown: failed to start child: Ingestory.Worker ** (EXIT) bad return value: {:error, :timeout}
05:34 <asonge> yeah, so
05:34 <asonge> remember how i said that init/1 blocks?
05:34 <magicstapler> But then debug messages of the connection start flowing.
05:34 <asonge> (it's not a race condition)
05:34 <asonge> so there's like 3 timeouts going on here.
05:35 milad joined
05:35 milad joined
05:36 <asonge> GenServer.start_link() has a timeout of 5_000. if the websocket takes longer than 5s to connect, then start_link will return an error, and the GenServer aborts.
05:36 <magicstapler> Whoa
05:37 <magicstapler> Ok, so it's not taking 5 seconds.
05:37 <magicstapler> I counted.
05:38 <magicstapler> 05:37:01.636 [debug] Connecting to wss://api.poloniex.com:443/... 05:37:03.611 [debug] timeout problem lol: timeout
05:38 <magicstapler> So, 2 seconds.
05:39 <asonge> how are you counting?
05:39 imack joined
05:39 <magicstapler> I was counting in my head, but I realized the debug log has the time.
05:40 <asonge> did you just log out "timeout problem lol" or something?
05:40 <magicstapler> Yeah.
05:40 <magicstapler> It's in the pastebin
05:40 <asonge> so, that's a different timeout
05:41 <asonge> that's the Spell.connect timeout that triggered
05:41 <asonge> and when you return an error from init, the start_link fails and returns the error
05:41 <asonge> which the supervisor notices and should retry
05:41 josevalim joined
05:43 <magicstapler> Weird, it's having a consistent behavior now.
05:44 <asonge> welp *shrug*
05:45 <magicstapler> Ok, so when it died with the timeout error the supervisor wasn't retrying.
05:45 <magicstapler> Is there a setting I need to toggle?
05:46 <magicstapler> I have opts = [strategy: :one_for_one, name: Ingestory.Supervisor]
05:50 <asonge> i'm trying to remember the precise behavior here.
05:50 wpcarro joined
05:56 <asonge> ah, i gotta go to bed, sorry magicstapler
05:57 <magicstapler> asonge: No worries, thanks for all of your help thusfar :)
05:59 <bitmod> what is the best authentication package out there?
05:59 <bitmod> seems to be guardian right?
06:01 steffkes joined
06:01 steffkes joined
06:07 icanhazbroccoli joined
06:09 yourname joined
06:13 <Cloudflare> Do I miss out on anything by learning Elixir instead of learning Erlang first?
06:13 <Cloudflare> By not understanding the fundamentals?
06:14 <Nicd-> Cloudflare: you will necessarily have to learn the fundamentals anyway
06:15 <Nicd-> and you will learn Erlang during working with Elixir
06:15 <Nicd-> it won't hurt to read about Erlang and BEAM though
06:16 <Cloudflare> Nicd-: Oh okay I guess I'll go with Elixir then ;)
06:17 <Nicd-> I started with Elixir after a very cursory look at some Erlang tutorial. I have learned during the way
06:18 <bitmod> what is the best authentication package out there?
06:23 Cohedrin joined
06:24 sfbw joined
06:26 petejkim joined
06:36 cryo28 joined
06:38 robinsjdotcom joined
06:41 tuacker joined
06:41 rschmukler joined
06:43 griffinbyatt joined
06:43 PaReeOhNos joined
06:49 justelex_ joined
06:50 ultra|lazer joined
06:53 petejkim joined
06:54 hakunin joined
06:55 jkreeftmeijer joined
06:55 jkreeftmeijer joined
06:57 papey_lap joined
06:58 jkreeftm_ joined
06:58 PaReeOhNos joined
06:59 cemilowski joined
07:00 steffkes joined
07:00 steffkes joined
07:03 mattyw joined
07:06 notdaniel joined
07:06 <Radar> bitmod: I've heard good things about Guardian
07:08 Guest67 joined
07:09 jkreeftmeijer joined
07:16 flaviodesousa joined
07:19 elgenie joined
07:19 ZippoWeb2 joined
07:21 PaReeOhNos joined
07:24 <ljarvis> I'm a fan of Guardian
07:25 petejkim joined
07:25 jkreeftmeijer joined
07:25 sfbw joined
07:28 asabil joined
07:30 mark_66 joined
07:33 PaReeOhNos joined
07:34 apotry joined
07:36 hbraun joined
07:37 PaReeOhNos joined
07:37 __0xAX joined
07:37 jkreeftmeijer joined
07:38 gvaughn joined
07:42 dch_ joined
07:42 colrack joined
07:44 griffinbyatt joined
07:44 <sevenseacat> I'm a fan of Blind Guardian, does that count?
07:45 DeadTrickster joined
07:52 akeating joined
07:53 clemlais joined
07:56 jeznet2 joined
07:59 PaReeOhNos joined
07:59 Guest67 joined
08:01 dignifiedquire joined
08:03 wpcarro joined
08:03 dastagg joined
08:04 marr joined
08:12 robinsjdotcom joined
08:12 ZippoWeb2 joined
08:14 PaReeOhNos joined
08:16 robinsjdotcom joined
08:17 hakunin joined
08:26 dch_ joined
08:27 sfbw joined
08:27 ctp joined
08:30 rschmukler joined
08:33 gvaughn joined
08:33 ultra|lazer joined
08:36 bhamilton joined
08:36 brycek joined
08:39 papey_lap joined
08:40 bhamilton joined
08:41 <cmk_zzz> I can declare a map like this: %{"hello" => "world"}, or this: %{"hello": "world"}, but they are not equivalent. THe first gives you a map with key: "hello" whereas the second gives a key as :hello. I find it inconsistent
08:41 <cmk_zzz> My guess is that : is some sort of syntactic sugar? which turns whatever before it into an atom to be supported in keyword lists?
08:42 <cmk_zzz> or am I out flying again
08:42 <Nicd-> the latter is atom key syntax
08:42 <Nicd-> it's meant like %{hello: "world"}
08:42 <cmk_zzz> so whatever I put before : is converted to an atom?
08:43 <Nicd-> not really converted, it is an atom. :"hello" == :hello
08:43 cemilowski joined
08:44 <cmk_zzz> well to me: %{"hello": "world"} and %{hello: "world"} are different
08:44 jkreeftmeijer joined
08:44 <ljarvis> it's useful for atoms that might have syntactically complex names, e.g. :foo-bar is invalid, but :"foo-bar" is fine. So you might write: %{"foo-bar": "world"}
08:44 griffinbyatt joined
08:45 <cmk_zzz> ok, I see. It is just a different way to specify an atmo
08:45 <cmk_zzz> atom
08:45 <Nicd-> %{hello: "world"} == %{:hello => "world"}
08:45 <ljarvis> right, I agree it's confusing. Ruby does the same thing and it's a bit annoying imo
08:45 <Nicd-> it's just an alternate syntax to make maps look nicer since usually you use atom keys
08:46 <cmk_zzz> yes, I am coming over into elixir from erlang and the amount of sugar here makes my liver throw up a little
08:46 jlpeters joined
08:46 <cmk_zzz> but I am getting there
08:46 <ljarvis> you're coming from erlang then you can't have syntax squabbles :)
08:46 inoas joined
08:47 zph joined
08:47 cmeik joined
08:47 <cmk_zzz> ljarvis: it is funny. I find elixir syntax much more verbose and hard to read for most use cases. But it is only syntax so I wont complain
08:48 <cmk_zzz> elixir has other strengths which I like
08:48 <ljarvis> sure, i can see why you would if you're used to erlang
08:48 <ljarvis> my face hurts when i read erlang, i've tried a few times to truly learn it, but i find the syntax incredibly difficult
08:50 <Nicd-> yeah, for me Elixir is much better
08:50 <cmk_zzz> have you done ruby before?
08:51 <ljarvis> I come from Ruby and write it in my day job
08:51 <ljarvis> so perhaps that's why (although i did try to learn erlang ~15 years ago before Ruby and failed)
08:52 ultra|lazer joined
08:53 Hawkheart joined
08:54 <cmk_zzz> anyway. I should have understood "hello": but lately I've been finding myself getting increasingly slow. A bit worrying actully
08:55 <Nicd-> I have never written ruby
08:55 lexmag joined
08:56 jkreeftmeijer joined
08:57 Cohedrin joined
09:00 <nox> Nicd-: Liar,
09:00 <nox> you write Elixir code, which is just like Ruby,
09:00 <nox> so you can't say you never wrote Ruby code.
09:03 eddd joined
09:03 guan joined
09:05 <benwilson512> nox: :eyeroll:
09:06 <nox> benwilson512: Is that a Ruby library?
09:07 <Nicd-> nox: what an insult
09:07 <nox> Nicd-: LOL
09:07 <Nicd-> although the quality of my code is probably an insult to both Elixir AND Ruby
09:09 <nox> Meanwhile in my land, I just access for some committer access to mozilla-central.
09:09 <nox> asked access* English 2hard4me.
09:10 <nox> s/committer access/committer rights/
09:11 pmonson joined
09:11 gjaldon__ joined
09:12 dbarrett joined
09:21 benwilson512 joined
09:22 pchittum joined
09:26 akraut joined
09:28 sfbw joined
09:29 jkreeftmeijer joined
09:30 jkreeftm_ joined
09:33 aaronjensen joined
09:35 DarkArcher_207 joined
09:37 Isaiah joined
09:37 eproxus joined
09:38 jkreeftmeijer joined
09:39 gmcabrita joined
09:40 jkreeftm_ joined
09:40 vikram__________ joined
09:40 soud joined
09:41 <soud> hey all, trying to use exredis in my phoenix application, but getting this error every time I'm trying to launch my application: https://bpaste.net/show/88aa444b237a . tried all versions of exredis, same result
09:41 <soud> any idea how to fix this?
09:42 zeeshanlakhani joined
09:44 zpconn__________ joined
09:44 jkreeftmeijer joined
09:45 griffinbyatt joined
09:46 joshdholtz joined
09:46 hvn joined
09:47 <benwilson512> soud: I'm not sure about that specific error, but you may want to check out the Redix library
09:47 <benwilson512> it's pure elixir, so it won't require using rebar
09:48 burbas joined
09:48 <whatyouhide> it's also supposed to perform a bit faster than eredis (exredis is built on top of that) :)
09:50 craigp joined
09:50 aedigix joined
09:53 sasajuric joined
09:58 jkreeftmeijer joined
10:03 Uniaika joined
10:06 inoas joined
10:06 gmcintire joined
10:08 akeating joined
10:09 robinsjdotcom joined
10:12 jkreeftmeijer joined
10:12 scottj joined
10:19 rschmukler joined
10:19 hakunin joined
10:21 gvaughn joined
10:21 jkreeftm_ joined
10:23 jadams|cloud joined
10:28 amitchellbullard joined
10:29 hvn joined
10:29 hvn joined
10:29 <soud> redix looks good, thanks
10:29 sfbw joined
10:32 dikaiosune joined
10:33 CStorm joined
10:34 justelex_ joined
10:40 justelex_ joined
10:46 justelex_ joined
10:46 kansi joined
10:46 griffinbyatt joined
10:52 teadrop_ joined
10:55 bigkevmcd joined
11:09 mika_ joined
11:10 meh` joined
11:11 elgenie joined
11:15 aedigix joined
11:16 <bitmod> when is phoenix 1.3 released?
11:18 clemlais joined
11:22 justelex joined
11:26 griffinbyatt joined
11:29 DarkArcher207 joined
11:31 sfbw joined
11:32 jkreeftmeijer joined
11:33 sfbw_ joined
11:36 wpcarro joined
11:37 <Nicd-> when it is done :)
11:37 hvn joined
11:37 hvn joined
11:43 justelex_ joined
11:46 aedigix joined
11:58 hbraun joined
11:59 ZippoWeb joined
12:03 aedigix joined
12:06 aedigix joined
12:07 justelex_ joined
12:08 ssswitch joined
12:09 aedigix joined
12:10 gvaughn joined
12:10 ZippoWeb joined
12:11 jerel joined
12:12 nomicflux joined
12:15 jkreeftmeijer joined
12:19 aedigix joined
12:20 marr joined
12:22 cschneid_ joined
12:26 PaReeOhNos joined
12:28 kronicdeth joined
12:29 PaReeOhNos joined
12:32 steffkes joined
12:32 steffkes joined
12:34 <bitmod> Nicd-: thanks mate :)
12:34 jkraus joined
12:35 <bitmod> also, has anyone here used sentinal?
12:35 <bitmod> *sentinel
12:35 hvn joined
12:35 sfbw joined
12:36 jkreeftm_ joined
12:38 kronicdeth joined
12:43 hakunin joined
12:43 akeating joined
12:46 eddd joined
12:47 dimitarvp joined
12:49 wpcarro joined
12:54 griffinbyatt joined
13:02 maxbeizer joined
13:05 gvaughn joined
13:06 rkazak joined
13:09 snappy_ joined
13:11 <snappy_> Hey everyone, I'd like to install a js/css dependency (bootstrap 4) in a phoenix app. What's the practical difference between adding to "devDependencies" vs "dependencies" in package.json?
13:12 <Nicd-> snappy_: that's really an npm question
13:12 <Nicd-> the semantic difference is that devDependencies are dependencies only needed for development
13:12 <Nicd-> personally I put into devDependencies tools and other stuff that does not end up in the final build
13:14 JEG2 joined
13:15 elgenie joined
13:15 <snappy_> Nicd-: Thanks. I was just confused as you can pass the `--production` flag to install devdependencies in production.
13:16 ZippoWeb joined
13:16 <rom1504> devDependencies don't get installed by packages depending on your app
13:16 <rom1504> but I guess nothing will depend on your app ? so it doesn't matter too much
13:18 <snappy_> Ah ok. Do I need to require the css/js files after I add the deps to package.json and `npm install --save`?
13:18 <snappy_> ...or does brunch handle that automagically?
13:19 whharris joined
13:19 wpcarro joined
13:21 laut joined
13:24 gem joined
13:26 jkreeftmeijer joined
13:28 rschmukler joined
13:30 kronicdeth joined
13:33 justelex joined
13:36 eddd joined
13:39 gvaughn joined
13:40 gokr left
13:40 gvaughn_ joined
13:41 rschmukler joined
13:41 hakunin joined
13:43 PaReeOhNos joined
13:43 wpcarro joined
13:45 asabil joined
13:49 kronicdeth joined
13:50 rschmukler joined
13:55 griffinbyatt joined
13:56 wpcarro joined
13:57 tuacker1 joined
13:57 hakunin joined
13:58 dimitarvp` joined
13:59 cevado joined
14:01 dimitarvp_ joined
14:06 hakunin joined
14:08 <iFire> there's a compile all step
14:08 <iFire> I forget the exact term
14:12 cemilowski joined
14:13 PaReeOhNos joined
14:15 cdg joined
14:17 justelex_ joined
14:19 rschmukler joined
14:20 gvaughn joined
14:20 kommen joined
14:21 gvaughn_ joined
14:24 wpcarro joined
14:24 DarkArcher207 joined
14:28 rschmukler joined
14:30 eddd joined
14:31 ZippoWeb joined
14:33 steffkes joined
14:35 rschmukler joined
14:36 <Ankhers> skell
14:36 <Ankhers> miss
14:37 wpcarro joined
14:39 maxbeizer_ joined
14:46 <bitmod> i just lost my custom sass after installing exadmin, what's the cause?
14:47 d10n-work joined
14:50 kronicdeth joined
14:52 wpcarro joined
14:53 rschmukler joined
14:53 mika_ joined
14:54 tuacker joined
14:58 griffinbyatt joined
14:59 rodolfojcj joined
15:00 sp4rrow joined
15:07 hakunin joined
15:08 gvaughn_ joined
15:09 <bitmod> anyone use exadmin before?
15:10 <bitmod> for some reason it's broken my sass styles
15:11 ZippoWeb joined
15:15 cschneid_ joined
15:17 craigp joined
15:19 92AAA0HW0 joined
15:22 refriedchicken joined
15:25 sillyotter joined
15:27 <bitmod> ok this is really strange, brunch is compiling my sass files but not writing them
15:28 cherrot joined
15:29 robinsjdotcom joined
15:31 elgenie joined
15:34 jkreeftm_ joined
15:34 icecreamcohen joined
15:34 davidw_ joined
15:34 jkreeftm_ joined
15:35 drincruz joined
15:35 icecreamcohen joined
15:36 jkreeftm_ joined
15:39 jkreeftmeijer joined
15:40 drincruz joined
15:45 asabil joined
15:49 cherrot joined
15:51 asabil joined
15:58 rkazak joined
15:58 asabil joined
16:00 Guest67_ joined
16:01 amclain joined
16:06 asabil joined
16:06 PaReeOhNos joined
16:09 rschmukler joined
16:11 petejkim joined
16:11 asabil joined
16:13 fernandomm joined
16:13 meandi_2 joined
16:21 rschmukler joined
16:21 greengriminal joined
16:21 wpcarro joined
16:22 jopecko joined
16:24 Cidan joined
16:24 jeznet3 joined
16:26 <iFire> bitmod: did you add the rules to the brunch config?
16:28 wsieroci joined
16:30 <bitmod> iFire: yeah, followed all that
16:30 <bitmod> for some reason adding those rules prevents my compiled sass files from being written to app.css (i believe)
16:31 PaReeOhNos joined
16:31 <bitmod> iFire: if you create a new app, install sass-bruch, mdir /web/static/sass, then install exadmin, you'll get the same issue
16:31 <bitmod> realy weird
16:34 steffkes joined
16:34 steffkes joined
16:35 hakunin joined
16:37 aaronjensen joined
16:37 akraut joined
16:37 burbas joined
16:38 Isaiah joined
16:39 stephen_m joined
16:40 zpconn__________ joined
16:40 amitchellbullard joined
16:40 pchittum joined
16:40 jlpeters joined
16:41 joshdholtz joined
16:41 CStorm joined
16:41 sasajuric joined
16:41 zph joined
16:41 eproxus joined
16:42 pmonson joined
16:42 teadrop_ joined
16:42 vikram__________ joined
16:42 gmcintire joined
16:42 zeeshanlakhani joined
16:43 benwilson512 joined
16:43 <hexkey[m]> hey guys I have a question
16:43 cmeik joined
16:43 gjaldon__ joined
16:43 <iFire> bitmod: not using phoenix 1.3 right?
16:43 jeffweiss joined
16:44 <Ankhers> hexkey[m]: Feel free to ask.
16:44 brycek joined
16:44 gem joined
16:44 dikaiosune joined
16:44 whharris_ joined
16:45 <hexkey[m]> am I doing this right?
16:45 <hexkey[m]> Enum.each(1..100, &(:math.pow(&1, 2))) |> IO.inspect(label: "result")
16:45 <hexkey[m]> the only thing being returned is the :ok atom, not the list
16:45 guan joined
16:45 jadams|cloud joined
16:45 wpcarro joined
16:46 mika_ joined
16:47 <Nicd-> Enum.each runs the code for each element but doesn't return anything
16:47 <Nicd-> you probably want to Enum.map
16:47 <hexkey[m]> I did...might be lag? In any case, I was wondering why this snipped returns the :ok atom instead of the list I'm expecting: Enum.each(1..100, &(:math.pow(&1, 2))) |> IO.inspect(label: "result")
16:48 <ciawal> read what Nicd- said, hexkey[m]
16:48 <hexkey[m]> I'm still getting used to the $ syntax
16:48 <hexkey[m]> *&
16:48 <Ankhers> hexkey[m]: You Enum.map, not Enum.each
16:48 petejkim joined
16:48 <Ankhers> s/You/Use
16:49 <Nicd-> Ankhers: unterminated `s' command
16:49 <hexkey[m]> yup, that was it, thanks!
16:50 steffkes joined
16:50 <Ankhers> Nicd-: I'm bad at typing lately :(
16:50 <Nicd-> hexkey[m]: the documentation for Enum.each states, "returns :ok" :) also, if you are looking for a Matrix channel, we have one (unofficial) on #elixirlang:matrix.org
16:51 <hexkey[m]> Also: does anyone know of any good explanations of the & syntax online? Nothing I've found so far has made it really click.
16:52 jopecko joined
16:52 lacrosse joined
16:53 <Ankhers> hexkey[m]: http://elixir-lang.org/crash-course.html#partials-and-function-captures-in-elixir
16:54 inoas joined
16:55 <Ankhers> I am finding myself avoiding using that syntax lately though. It is cool when you first learn it, but I find the expressiveness of `fn x -> ... end` to be better. People not knowing elixir can look at your code and know what is happening.
16:55 inoas joined
16:55 <Ankhers> Saving a few keystrokes is not worth it for me.
16:55 <bitmod> iFire: nope, 1.2
16:56 <OliverMT> Ankhers: function capture is a perl coders wet dream
16:56 rschmukler joined
16:59 griffinbyatt joined
17:00 notdaniel joined
17:03 rkazak joined
17:03 petejkim joined
17:03 <Ankhers> ericmj: ping
17:03 bionj joined
17:04 heathermoore joined
17:06 auxbuss joined
17:08 <havenwood> hexkey[m]: https://gist.github.com/havenwood/4738e57946e0af14e0f273bd833a7444
17:08 <pbj> anyone have sass working on the phoenix rc?
17:09 <Ankhers> yup
17:09 <Ankhers> One sec and I will gist my brunch config
17:10 hbraun joined
17:10 <pbj> tx
17:10 <pbj> *thx
17:11 <hexkey[m]> havenwood: thanks
17:11 jkraus_ joined
17:13 <Ankhers> pbj: https://gist.github.com/ankhers/89363cf7ffe9bfdb82e3b7d10bad07c8
17:14 PaReeOhNos joined
17:16 pbj joined
17:16 rschmukler joined
17:20 petejkim joined
17:25 cemilowski joined
17:26 <bitmod> if i'm starting a new project should i do it with 1.3-rc or wait until the official comes out?
17:28 rschmukler joined
17:28 <hexkey[m]> Generally, I'd use the latest stable release in any language.
17:28 <hexkey[m]> unless you really want to use some new bleeding edge feature, I suppose.
17:29 pbj joined
17:29 wpcarro joined
17:29 <ivan> what do I put in the main function of an escript to keep a plug server running? I already have an Application with a plug child
17:30 <bitmod> hexkey[m]: as long as upgrading to 1.3 isn't too difficult
17:30 <Ankhers> It depends really.
17:30 <ivan> :timer.sleep(:infinity) I guess?
17:31 <hexkey[m]> https://github.com/phoenixframework/phoenix/releases
17:31 <hexkey[m]> Looks like a lot of changes
17:33 <Ankhers> How long until you expect to be in production?
17:33 <hexkey[m]> the real question is if updating will be easier from 1.2.1 or 1.3.0-rc.0 to the next one will be easier
17:33 <Ankhers> I'm currently in the testing phase of an application and I upgraded to phoenix 1.3-rc.0 as soon as I noticed I could.
17:33 <Ankhers> Upgrading was actually really simple. So I wouldn't worrt about that
17:34 <hexkey[m]> related: https://en.wikipedia.org/wiki/Software_release_life_cycle#Release_candidate
17:34 PaReeOhNos joined
17:35 Cohedrin joined
17:36 InternetFriend joined
17:40 wpcarro joined
17:47 petejkim joined
17:51 akeating joined
17:51 peterpp joined
17:56 <peterpp> I'm looking for a way to iterate over a map and update its values
17:56 <benwilson512> peterpp: are you gonna be removing or adding keys?
17:56 <peterpp> no
17:56 jopecko joined
17:56 <peterpp> the keys remain the same
17:57 <peterpp> in principle I'd be able to loop over a map's keys
17:57 <peterpp> and update the corresponding value one-by-one
17:57 <peterpp> but I was wondering if there's a better way to go about it, perhaps with a better runtime performance
17:58 <Nicd-> you might want to consider if a map is the correct data structure for your case
17:58 <peterpp> I definitely need a way access values by keys
17:59 <peterpp> a keyword list would make it very convenient to iterate over its elements and update as necessary
17:59 <peterpp> but lookups are O(n), no?
18:00 <Nicd-> yes
18:00 griffinbyatt joined
18:00 <Nicd-> how often are you doing each operation?
18:00 <peterpp> it's in the main loop of my server
18:00 <peterpp> quite often
18:01 <peterpp> I need to do both operations quite often
18:01 justelex_ joined
18:02 ZippoWeb joined
18:02 strykerkkd joined
18:03 rschmukler joined
18:07 maxbeizer joined
18:09 <Ankhers> peterpp: You could do something like Enum.into. Unfortunately Enum.map when used on a Map returns a keyword list.
18:09 <peterpp> that would mean rebuilding the map from scratch every time, or am I wrong
18:09 LastContinue joined
18:10 <peterpp> I have no idea what Elixir does under the hood, but I suspect the runtime performance will be quite low, no?
18:11 <peterpp> maybe I should just iterate over the keys and see what the performance is like
18:11 <Ankhers> Yeah. It would be possible to do something compbining Map.keys/1, Enum.map/2 and Map.get_and_update/3.
18:11 <Ankhers> I'm not sure the performance of something like that though.
18:12 <Ankhers> It is something you would need to test.
18:12 <peterpp> but is there a technical or ideological reason as to why there's no function in Map that lets me do what I want?
18:12 squalloser joined
18:13 rschmukler joined
18:14 <Ankhers> don't quote me on this, but maybe because most people don't need random access and to update the entire map in one go.
18:15 <Ankhers> I needed something like this once, and it was in golang. I essentially had a process that was running once every 15ish seconds that would update the map. Everything is just got a pointer to the map at that time.
18:16 <Ankhers> I don't know your requirements, but maybe have a GenServer that holds your map, have an operation to grab the current map, and an operation that can replace the entire map.
18:17 <Ankhers> But I don't know how frequently you need to update your map.
18:17 <peterpp> I'm writing a game server and the map currently holds the game state
18:17 <peterpp> part of the state anway
18:20 <Ankhers> Not that this part makes much of a difference. But hopefully you are using a struct and not just a map?
18:20 PaReeOhNos joined
18:21 <drewolson> peterpp do you know what keys you want to update as your update them? why would you iterate over the keys?
18:21 <Ankhers> So wouldn't you just want to update a mall portion of the state at any given time, not the entire thing?
18:21 milad joined
18:21 <Ankhers> s/mall/small/
18:21 <peterpp> to determine which values I need to update
18:21 <Ankhers> Wouldn't you know that based on an action from the client?
18:22 <peterpp> I could also loop over the values first and get the set of keys I need to update
18:22 jkraus joined
18:23 <drewolson> i'm sorry, i don't understand. wouldn't the client send both the key and the value to the server in order to specify the fields to update?
18:24 refriedchicken66 joined
18:25 <notriddle> A map can be treated as an Enum, so code like this works: `%{a: 1, b: 2} |> Map.new(fn {key, value} -> {key, value + 1})`
18:25 pbj joined
18:26 <notriddle> I'm assuming your usecase is something like a %{ character_id => position } map?
18:26 <peterpp> drewolson, yes, I could, but I was hoping I could get away with the 'bruteforce' approach in a prototype
18:27 <Ankhers> peterpp: That sounds like more work to be honest.
18:27 <notriddle> Erm, `%{a: 1, b: 2} |> Map.new(fn {key, value} -> {key, value + 1} end)` is the correct snippet. I forgot the `end` part of the function.
18:27 rschmukler joined
18:27 <drewolson> peterpp here's basically what i'd do https://gist.github.com/drewolson/5c03f689fe4e365dbc03d9fe399e59f8
18:27 <drewolson> but it assumes that the client sends both the keys and values to update
18:28 <drewolson> that would run in O(n) time where n is the number of k/v pairs you want to update
18:28 <Ankhers> I think I would hold the state in a GenServer, and have various operations on the GenServer to change different parts of the state.
18:30 <peterpp> drewolson, it wouldn't have occurred to me to use reduce like that, thank you for the snippet!
18:30 <drewolson> Ankhers yeah, sure, but the question was about maps
18:31 <drewolson> peterpp you could also just use `Map.put` directly
18:31 <Ankhers> Yes, but if the GenServer knows the state, and it has the logic to update the state, you don't really need to send kv pairs. You could just send an operation to do, maybe some values depending on the operation, and have the GenServer just know what to do.
18:32 <peterpp> somehow I'm hesitant to use separate processes because I'm not yet familiar with the runtime characteristics
18:32 rschmukler joined
18:32 <Ankhers> wouldn't a prototype be a good place to learn them though?
18:33 icecreamcohen joined
18:33 <peterpp> btw I'm very new to Elixir in case it wasn't obvious ;-)
18:33 <Ankhers> Also, Elixir and Erlang have very little overhead in terms of spawning and running processes.
18:33 <peterpp> well, I do have separate processes of course for such things as listening to the various client sockets etc
18:34 <Ankhers> And it is a very common thing to do to hold state.
18:34 maxbeizer_ joined
18:36 <drewolson> you could use an Agent if it is just state
18:38 <peterpp> an Agent? that's something I'm not yet familiar with apparently
18:39 <Ankhers> It is basically GenServer lite.
18:39 <peterpp> I think I've figured out what I'm going to do, though
18:39 <peterpp> thanks so much for picking up my question, Ankhers and drewolson
18:40 <drewolson> peterpp here's an agent example https://gist.github.com/drewolson/71a10de87f5e35db4f63a2ace1f82de8
18:41 petejkim joined
18:41 <andman> peterpp: btw, I believe the upcoming book https://pragprog.com/book/lhelph/functional-web-development-with-elixir-otp-and-phoenix (in beta now) builds a game server as an example, might be of interest
18:41 <peterpp> andman, oh wow, thanks for the pointer!
18:43 <* notriddle> isn't sure that the "use a process" suggestion is a good idea, but doesn't really know enough about the problem to tell for sure.
18:44 whharris joined
18:49 PaReeOhNos joined
18:51 JuanMiguel joined
18:52 mika__ joined
18:58 rschmukler joined
19:00 lexmag joined
19:00 griffinbyatt joined
19:01 elgenie joined
19:03 PaReeOhNos joined
19:03 yourname joined
19:06 steffkes joined
19:06 steffkes joined
19:09 cevado joined
19:11 jkraus joined
19:21 rodolfojcj joined
19:21 hashpuppy joined
19:23 <sorentwo> I think it will finally be possible to connect to running nodes on heroku with https://devcenter.heroku.com/articles/heroku-exec
19:23 refriedchicken joined
19:31 PaReeOhNos joined
19:34 davidw_ joined
19:38 icecreamcohen joined
19:38 <Ankhers> notriddle: Why not? You wouldn't want a bunch of processes modifying the game state at the same time.
19:38 rschmukler joined
19:39 Cohedrin joined
19:48 rschmukler joined
19:52 gem joined
19:53 wpcarro joined
19:54 rschmukler joined
19:55 <notriddle> Right, you wouldn't want a bunch of processes modifying the game state at the same time, but that wasn't the question. The question was how to mutate all the values in a K/V map. You probably don't want a separate process for every Value.
19:56 bionj joined
19:56 bionj joined
19:56 jbomo joined
19:58 bambanx joined
20:01 wpcarro joined
20:02 griffinbyatt joined
20:03 rschmukler joined
20:04 PaReeOhNos joined
20:04 petejkim joined
20:04 dimitarvp` joined
20:06 justelex_ joined
20:08 asabil joined
20:18 whharris joined
20:19 xlsssleo joined
20:19 <Ankhers> notriddle: I know that. I never suggested each value should be in its own process. I suggested having a GenServer look after the entire state. Then any process could say "draw card" or whatever else needs to be done and the GenServer would handle all of the logic of updating the state.
20:23 <notriddle> Sure, but that doesn't actually answer the question. The question was about how to modify a map, not about what kind of control (if any) should be laid over the top of the map.
20:25 cdg joined
20:25 <Ankhers> Yes, but the approach to the problem was incorrect. They admitted to not actually needed to update the entire map. It was only portions of it depending on the action that was done by the client.
20:41 sfbw joined
20:41 jopecko joined
20:43 dimitarvp` joined
20:44 dimitarvp_ joined
20:44 InternetFriend joined
20:52 notdaniel joined
20:55 pbj joined
20:57 Ven joined
20:58 mika_ joined
21:02 griffinbyatt joined
21:04 wpcarro joined
21:06 mika__ joined
21:07 steffkes joined
21:10 kau joined
21:13 hakunin joined
21:16 whharris joined
21:16 jamilbk joined
21:20 asabil joined
21:22 wpcarro joined
21:34 gem joined
21:38 mika__ joined
21:47 Havvy joined
21:50 wpcarro joined
21:52 wwwd joined
22:14 wpcarro joined
22:18 milad joined
22:21 micmus joined
22:26 icanhazbroccoli joined
22:27 pbj joined
22:38 davidw_ joined
22:40 rschmukler joined
22:48 OtherAllan joined
22:52 wpcarro joined
22:55 rschmukler joined
23:00 jopecko joined
23:01 Cohedri__ joined
23:04 griffinbyatt joined
23:08 steffkes joined
23:08 steffkes joined
23:10 jopecko joined
23:15 cschneid_ joined
23:15 rozap joined
23:16 refriedchicken joined
23:16 <rozap> bitwalker: is there a way to make distillery fail a build if there is dep missing from the app list?
23:17 <rozap> the warning is nice, but we're hoping to get our CI to just fail the build if there are any things in that warning list
23:17 griffinbyatt joined
23:19 chrismccord joined
23:19 <bitwalker> there isn't, and that's primarily because Elixir 1.4 has already solved this problem moving forward (everything in deps is automatically in the applications list unless it's not available in the release env (because `only: [...]` was used, or `runtime: false` is set in it's options)
23:19 mika__ joined
23:26 InternetFriend joined
23:27 gvaughn_ joined
23:33 wpcarro joined
23:39 greg_n joined
23:42 jopecko_ joined
23:46 wpcarro joined
23:47 ssswitch joined
23:51 amclain joined
23:57 wpcarro joined