<    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 _2_8 29  
30
00:14 fowlduck joined
00:18 srxa joined
00:21 potatosalad joined
00:22 griffinbyatt joined
00:27 duane joined
00:32 potatosa_ joined
00:47 bitshift joined
00:50 <dongo> Hi. I'm trying to write a simple ogg vorbis metadata parser and I'm hitting a small issue. There's a variable length value that I'm trying to pattern match on but it doesn't match. If you take a look at the ogg vorbis specification here https://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-820005 you can see, if you look down a bit, "2) [vendor\_string] = read a UTF-8 vector as [vendor\_length] octets" and
00:50 <dongo> that is what I'm trying to get. Here's my code: https://ghostbin.com/paste/ovmvu Line 74 is the issue. Any ideas on what could be causing the issue?
00:55 jerel joined
01:02 cemilowski joined
01:03 potatosalad joined
01:07 raycoll joined
01:09 myronmarston joined
01:11 Cthalupa joined
01:15 fowlduck joined
01:16 <iFire> dongo: if it helps I've been using a elixir matching lib
01:17 chavito joined
01:17 <dongo> iFire: what's it called?
01:17 <iFire> give me a second
01:18 <iFire> https://github.com/ScrimpyCat/Tonic
01:18 racycle joined
01:18 hahuang61 joined
01:19 <iFire> apache license it when you're done :)
01:20 <iFire> it's basically copy and paste, but maybe this abstraction helps
01:23 griffinbyatt joined
01:24 <iFire> dongo: I followed the guide on the png example but then i realized I need more abstraction
01:24 <iFire> http://www.zohaib.me/binary-pattern-matching-in-elixir/
01:24 <iFire> so I looked for this lib and the good thing is the two docs are about png
01:25 <iFire> so you can see the difference
01:25 <dongo> Oh yeah I've read that articlwe
01:25 <dongo> article*
01:25 <dongo> The library looks good and I'll take a look at it
01:28 Cthalupa joined
01:28 cemilowski joined
01:39 tomterl joined
01:41 kronicdeth joined
01:42 Sgeo joined
01:42 bionj joined
01:45 cemilowski joined
01:48 potatosalad joined
01:52 milad joined
01:56 jkreeftmeijer joined
01:56 griffinbyatt joined
01:57 steffkes joined
02:07 Ioyrie joined
02:15 raycoll joined
02:16 fowlduck joined
02:24 zv joined
02:25 oschwald joined
02:30 sfbw joined
02:48 <iFire> dongo: how did it go?
02:49 <dongo> iFire: gonna take a look at it later, right now I need to sleep
02:51 milad joined
02:54 dignifiedquire joined
02:55 meandi_2 joined
02:57 jkreeftmeijer joined
02:59 kronicdeth joined
03:02 sevenseacat joined
03:04 duane joined
03:16 fowlduck joined
03:19 hahuang61 joined
03:22 gk_1wm_su joined
03:23 gk_1wm_su left
03:27 rawtaz joined
03:31 duane joined
03:32 polymetis joined
03:35 cmhobbs joined
03:36 <cmhobbs> hello, folks! is there anything builtin that'll allow me to convert a hex string to binary?
03:40 sfbw joined
03:44 <iFire> considering we were just talking about turning ogg into a elixir struct, probablyy
03:44 <iFire> the music format binary file
03:45 gk_1wm_su joined
03:47 gk_1wm_su left
03:48 <cmhobbs> hm
03:48 <asonge> cmhobbs: see the Base module
03:51 milad joined
03:57 steffkes joined
03:59 <cmhobbs> asonge: ok, thanks
03:59 jerel joined
04:01 duane joined
04:08 nitro44x joined
04:10 griffinb_ joined
04:15 kotedo joined
04:16 <kotedo> Howdy! Can I create an escript inside a Phoenix App so that I can start the escript and get access to the Phoenix app? I hope that makes sense ...
04:17 nitro44x left
04:17 fowlduck joined
04:19 <kotedo> /?
04:24 duane joined
04:29 griffinbyatt joined
04:38 kotedo joined
04:41 sfbw joined
04:50 duane joined
04:58 jkreeftmeijer joined
05:04 cmhobbs left
05:12 jmcintosh joined
05:17 nomicflux joined
05:18 fowlduck joined
05:20 hahuang61 joined
05:30 srxa_ joined
05:34 duane joined
05:39 milad joined
05:41 sfbw joined
05:59 steffkes joined
06:06 Roger_ joined
06:09 Roger_ left
06:13 gvaughn joined
06:15 rokf joined
06:19 fowlduck joined
06:26 bionj joined
06:39 milad joined
06:45 sfbw joined
06:59 hflw joined
07:00 jkreeftmeijer joined
07:00 minus joined
07:02 tuacker joined
07:02 JuanMiguel joined
07:10 nahtnam joined
07:12 nd__ joined
07:19 fowlduck joined
07:21 hahuang61 joined
07:27 squallstter joined
07:30 Sgeo joined
07:37 ZippoWeb joined
07:38 hflw54 joined
07:40 dani0_ joined
07:43 rokf joined
07:46 sfbw joined
07:50 tuacker1 joined
07:59 steffkes joined
07:59 steffkes joined
08:01 duane joined
08:01 jkreeftmeijer joined
08:02 polymetis joined
08:02 gvaughn joined
08:02 polymetis joined
08:04 polymetis joined
08:14 MotherFlojo joined
08:16 duane joined
08:20 fowlduck joined
08:20 harfangk joined
08:27 milad joined
08:28 gokr joined
08:31 duane joined
08:40 imush joined
08:43 harfangk joined
08:47 sfbw joined
08:51 srxa joined
08:51 milad joined
08:52 colrack joined
08:52 wsieroci joined
08:53 colrack joined
08:54 duane joined
08:57 gmcabrita joined
09:01 stephen_m joined
09:01 Gasher joined
09:03 Guest67 joined
09:15 jkreeftmeijer joined
09:16 colrack joined
09:19 lexmag joined
09:21 fowlduck joined
09:22 hahuang61 joined
09:25 the_voice- joined
09:28 MotherFlojo joined
09:29 dani0_ joined
09:30 the_voice- joined
09:50 gvaughn joined
09:51 jkreeftmeijer joined
09:56 jkreeftmeijer joined
10:00 steffkes joined
10:00 steffkes joined
10:00 gokr joined
10:05 <mrus> It appears to me that either Ecto or Poison.Encode does not function in a correct manner. It seems impossible to work with an :id that's of type :binary_id (UUID) and have Poison.Encode return the correct string representation of it.
10:06 <mrus> I hooked into Poison.Encode and performed an Ecto.UUID.load(value) and it works. But that looks to be rather a very ugly hack.
10:09 dastagg joined
10:11 jkreeftmeijer joined
10:19 MotherFlojo joined
10:22 fowlduck joined
10:29 ctp joined
10:36 sfbw joined
10:39 MaSven joined
10:40 ZippoWeb joined
10:55 JuanMiguel joined
11:02 wsieroci joined
11:05 bionj joined
11:16 Nycatelos joined
11:19 jkreeftmeijer joined
11:22 fowlduck joined
11:24 hahuang61 joined
11:33 DeadTrickster joined
11:33 duane joined
11:39 gvaughn joined
11:51 wsieroci joined
11:54 duane joined
11:56 smt_ joined
11:57 tuacker joined
12:00 gopalindians joined
12:02 steffkes joined
12:02 steffkes joined
12:06 bionj joined
12:13 am55 joined
12:14 MotherFlojo joined
12:23 fowlduck joined
12:24 wsieroci joined
12:25 HoloIRCUser1 joined
12:26 ctp joined
12:36 rranelli joined
12:37 sfbw joined
12:43 egis joined
12:45 ZippoWeb joined
12:46 claudevandort joined
12:58 MotherFlojo joined
13:02 <iFire> mrus: does posion have the equivilent of https://github.com/elixir-ecto/ecto/blob/master/lib/ecto/type.ex#L3
13:02 <iFire> poison*
13:06 bionj joined
13:11 Guest67 joined
13:13 asabil joined
13:14 dani0_ joined
13:19 gopalindians_ joined
13:20 jkreeftmeijer joined
13:23 MotherFlojo joined
13:24 fowlduck joined
13:25 hahuang61 joined
13:27 gvaughn joined
13:35 HoloIRCUser4 joined
13:40 gokr joined
13:46 nomicflux joined
13:49 jerel joined
14:00 JuanMiguel joined
14:02 steffkes joined
14:02 steffkes joined
14:08 josevalim joined
14:10 duane joined
14:11 dimitarvp joined
14:20 peterpp joined
14:22 chavito joined
14:23 sfbw joined
14:25 fowlduck joined
14:26 potatosalad joined
14:30 marr joined
14:35 bitmod joined
14:44 claudevandort joined
14:46 bionj joined
14:59 dani0_ joined
15:03 dignifiedquire joined
15:04 milad joined
15:13 colrack joined
15:16 gvaughn joined
15:18 potatosalad joined
15:18 jkraus joined
15:22 lexmag joined
15:23 jkreeftmeijer joined
15:23 sfbw joined
15:24 rodolfojcj joined
15:26 hahuang61 joined
15:26 fowlduck joined
15:30 racycle joined
15:36 meh` joined
15:38 parisianSummer_ joined
15:39 <iFire> http://www.radgametools.com/telemetry.htm
15:39 <iFire> oops
15:39 <iFire> wrong chat
15:47 polymetis joined
15:53 raycoll joined
16:00 milad joined
16:03 steffkes joined
16:03 steffkes joined
16:04 Ven joined
16:05 griffinbyatt joined
16:05 griffinbyatt joined
16:06 rodolfojcj joined
16:13 gvaughn joined
16:15 fhoffmann joined
16:17 craigp joined
16:19 gopalindians joined
16:24 steffkes joined
16:26 fowlduck joined
16:32 milad joined
16:35 griffinbyatt joined
16:39 bitmod joined
16:39 ddrmanxbxfr joined
16:45 asabil joined
16:46 squallstter joined
16:47 bionj joined
16:48 duane joined
16:48 cdg joined
16:49 <mrus> iFire: the issue was solved. If you're interested about the details: https://github.com/elixir-ecto/ecto/issues/2026 :-)
16:51 <iFire> mrus: My answer is the same as "The implementation seems to be missing the dumpers and loaders for binary_id type:"
16:51 MotherFlojo joined
16:51 <iFire> which I linked to at the github link
16:52 <iFire> curiously, it's also what I've been dealing with for the last few hours :)
16:52 <iFire> my code is breaking when I do a select ? [1]
16:53 <iFire> where [1] is a input parameter
16:53 imush joined
16:54 dani0_ joined
16:56 duane joined
16:57 <mrus> Ah, I understand
16:58 <mrus> Sorry, I'm quite new to all that Elixir stuff :)
16:58 MotherFlojo joined
17:10 claudevandort joined
17:24 sfbw joined
17:24 jkreeftmeijer joined
17:26 jerel joined
17:27 hahuang61 joined
17:27 jmiven joined
17:27 fowlduck joined
17:34 josevalim joined
17:35 gvaughn joined
17:35 bionj joined
17:38 <bitmod> i'm getting a lot of "deprecated" warnings when running mix ecto.create, any ideas what i'm missing?
17:38 <bitmod> i'm assuming something is out of date, but i haven't got anyway "update" requests
17:38 JuanMiguel joined
17:39 <bitmod> *any
17:42 <bitmod> i'm on version 1.4.2-1 (pacman), so i guess it's not elixir itself
17:43 MotherFlojo joined
17:44 gopalindians_ joined
17:45 <Nicd-> what's your phoenix version? what kind of warnings?
17:49 <iFire> micmus: can you explain how the dumper and loader system in ecto works?
17:56 jkraus joined
17:56 marr joined
17:59 harfangk joined
18:02 <josevalim> iFire: what would you like to know?
18:02 <josevalim> the dumper and loader system is for adapters
18:02 <josevalim> are you working on an adapter/
18:02 <josevalim> ?
18:09 <iFire> yes
18:09 <iFire> my adapter is breaking doing prepared queries with parameters for a statement like "SELECT ?" [1]
18:10 <iFire> The actual query is "SELECT w0."id", w0."randomnumber" FROM "world" AS w0 WHERE (w0."id" = ?) [9778]" but it's not so simple
18:10 <iFire> I have a version that is working a version that isn't but I can't determine why
18:10 <bitmod> Nicd-: sorry, had to head out. These are the warnings it gave me: https://paste.ubuntu.com/24349541/. From the looks of it, it seems like ecto is out of date, but isn't ecto a part of the elixir package?
18:11 <iFire> josevalim:
18:11 <josevalim> iFire: the dumpers and loaders are functions that are invoked to cast a given value to the database type
18:11 <josevalim> the problem with "SELECT ?" [1] is that we don't know the type if the parameter
18:11 <josevalim> so we can't cast it in anyway
18:11 <Nicd-> bitmod: ecto is its own library
18:12 <josevalim> unless your database tell you the type, like postgres does
18:12 <iFire> yeah, I gathered that
18:12 <josevalim> which adapter is it?
18:12 <bitmod> Nicd-: is it included with phoenix?
18:13 <iFire> josevalim: I wrote a one from looking at the postgres and mysql adapters. it's called snappydata_ecto and I've only got it functionala in phoenix a few days ago.
18:13 <Nicd-> bitmod: no
18:13 <Nicd-> bitmod: check your mix.exs for the ecto dependency
18:13 <josevalim> phoenix_ecto dependency most likely
18:13 <iFire> josevalim: it's not very complete as a warning
18:14 <iFire> josevalim: anyways in my tests if I create a table the query returns useful info, but somehow that isn't working now
18:14 <bitmod> ah ok, the dependency listed in mix.exs is for v 2.0.0, current is at 2.1.4
18:16 chavito joined
18:16 <bitmod> Nicd-: regarding phoenix, will i have to change dependency versions in mix.exs often? Is there no way of keeping phoenix up to date so all its dependencies are at their latest versions?
18:16 <tristan__> are there docs on how genstage does backpressure
18:18 <tristan__> digging through the docs on hexdocs right now
18:18 <iFire> josevalim: database tell you the type, like postgres does what do you mean?
18:18 <iFire> like the database won't know that 1 is a integer unless we assume that it is a integer 32 numerical or a integer 64
18:19 <tristan__> oh, 'A dispatcher that accumulates demand from all consumers before broadcasting events to all of them.'
18:19 <tristan__> hm
18:22 <bitmod> all sorted, thanks
18:22 <josevalim> tristan__: it is as fast as the slowest consumer
18:22 <josevalim> tristan__: but that's for the broadcast dispatcher
18:23 <josevalim> tristan__: which is designed to work like that
18:23 <josevalim> tristan__: other dispatchers may have different behaviour
18:23 <josevalim> you can have a dispatcher that just drops events for slowest consumers
18:23 <josevalim> iFire: if you do this, "select ?::integer" postgres will tell you it expects an integer there
18:23 <josevalim> so you can do the proper casting
18:24 <josevalim> tristan__: most dispatchers are not broadcasting though, so they will emit to whatever consumer is available
18:24 <iFire> select CAST(1 as integer);
18:24 <iFire> something like that?
18:25 <iFire> I'm going to try that approach again
18:26 <iFire> Anyways the problem is I'm getting DBConnection.Query.Snappyex.Query.encode_values([], [3366], []) where the encoder gives up because it doesn't know that 3366 is a integer in the adpter
18:26 jkreeftmeijer joined
18:26 <tristan__> josevalim: ok. yea, I'm basically implementing a broadcast dispatcher that I want to not be as slow as the slowest consumer but still adjust its polling based on the slowest, to try to keep the required caching of what the slowest is behind on from growing to quickly
18:26 steffkes joined
18:26 nomicflux joined
18:26 <iFire> so I have to tell it that because is_integer(1) is valid it's a :integer type
18:27 <tristan__> was hoping to find prior art, hehe
18:27 <josevalim> iFire: so you either need to assume what type it is
18:27 <josevalim> or you need to have the database tell you
18:27 <josevalim> for postgres, the database tells
18:27 <josevalim> for mysql, it doesn't
18:27 <josevalim> so you likely hvae to assume that an integer is should be encoded as a DB integer
18:28 fowlduck joined
18:28 <josevalim> tristan__: broadcast dispatcher was meant to be a gen event replacement so it keep similarish properties
18:28 <josevalim> except gen event takes TIME = SUM(handlers)
18:28 <josevalim> and gen stage + broadcast is TIME = MAX(handlers)
18:29 <tristan__> makes sense
18:30 <iFire> https://github.com/elixir-ecto/ecto/blob/master/lib/ecto/adapters/mysql/connection.ex#L446 wait what
18:30 <iFire> does that look like the mysql casts integers to a string?
18:32 <josevalim> it is because mariaex is encoding an integer as the string presentation of the integer
18:32 <iFire> actually I'm getting lost, should this be in the ecto adapter or the sql adapter
18:33 <bitmod> what happened with moving /web into /lib for phoenix?
18:33 <iFire> bitmod: whenever the phoenix version is released?
18:33 MotherFlojo joined
18:33 <iFire> I think it's in rc stage. Don't remember.
18:34 <bitmod> got it
18:35 embik joined
18:40 gvaughn joined
18:45 vmoravec joined
18:46 gopalindians__ joined
18:52 dani0_ joined
18:54 Exuma joined
18:54 <Exuma> Hey, I saw this thread why ^ is needed in ecto queries and I still dont understand http://stackoverflow.com/questions/40484790/why-are-pin-operators-necessary-in-ecto-queries
18:55 <Exuma> all the answers basically say "its for interpolation" (not really a 'pin')
18:55 <Exuma> but, I still dont understand how username = "x" is any different from ^username (which is still "x") ... in reference to a comparison
18:57 <benwilson512> Exuma: it was an intentional design decision to make it explicit when external values are being used in the query
18:58 <Exuma> sorry if this is dumb, but isnt x = 1; where: u.age == x pretty explicit?
18:58 <benwilson512> here's a good example
18:58 wsieroci joined
18:58 <benwilson512> where: u.created_at == now
18:58 <benwilson512> is now the postgres function?
18:58 <benwilson512> or a variable?
18:59 <benwilson512> with ^ there's never any ambiguity between DSL delimiters and external variable values
18:59 <Exuma> hmm, I see. is now actually a real ecto method that activates PG's NOW()?
18:59 <benwilson512> ah actually no I thought it was, but the same issue applies with say
19:00 kyrix joined
19:00 <benwilson512> count, min or any of the 1 arity functions
19:00 <benwilson512> what if you have a function by that name in the module?
19:00 <Exuma> ahhhh
19:01 <benwilson512> you can safely just where u.age == ^min(blah) and know it'll use a local min function and inject the result in
19:01 <benwilson512> vs using the DSL min
19:01 <Exuma> so, the bottom line is that ^ allows you to explicitly say "this is coming from a variable" rather than some possibly conflicting function by the same name, that might be a part of Ecto itself
19:02 <Exuma> That was a good explanation, thank you
19:02 <Exuma> I'm still wrapping my head around this (coming from rails). I actually hate AR because it's never flexible enough. I end up doing insane things with it, and pushing it to the limit
19:02 <Exuma> Im really liking Ecto, although it's taking me a bit to get up to speed
19:10 <iFire> josevalim: so apparently just putting a prepared statement parameter doesn't work.
19:10 <iFire> if the original statement doesn't have a type
19:11 <iFire> because it's unknown
19:15 <Nicd-> bitmod: you don't really want that
19:15 <bitmod> Nicd-: what's that?
19:15 <Nicd-> bitmod: to always have the latest versions, because that will break things
19:16 <bitmod> Nicd-: fair point, hadn't considered that
19:17 <Nicd-> but you could do it by specifying something like "~> 1" for phoenix version for example
19:17 <Nicd-> it would get any 1.x.x version I think
19:17 <Nicd-> or just ">= 0.0.0"
19:18 duane joined
19:23 racycle joined
19:23 griffinbyatt joined
19:23 bionj joined
19:25 sfbw joined
19:26 JuanMiguel joined
19:26 wsieroci_ joined
19:27 hahuang61 joined
19:28 raycoll joined
19:28 wsieroc__ joined
19:29 fowlduck joined
19:30 MotherFlojo joined
19:33 nd__ joined
19:38 Cthalupa joined
19:45 peterpp joined
19:53 m1dnight_ joined
20:06 raycoll joined
20:09 milad joined
20:10 Exuma joined
20:19 peterpp joined
20:22 strykerkkd joined
20:24 griffinbyatt joined
20:24 bionj joined
20:25 bionj joined
20:26 sfbw joined
20:27 steffkes joined
20:27 jkreeftmeijer joined
20:28 raycoll joined
20:29 fowlduck joined
20:39 griffinbyatt joined
20:41 gvaughn_ joined
20:41 bionj joined
20:42 bionj_ joined
20:45 Vynlar joined
20:45 bionj__ joined
20:46 <Vynlar> Hello! I installed phoenix/elixir several months ago, and therefore am on version 1.2.1 of phoenix. I want to create a new phoenix project using the latest version. I re-did the installation directions but it doesn't appear that it actually changed the version I'm using. How can I upgrade my version of Phoenix to create a new project with the latest version?
20:47 bionj joined
20:47 <stephen_m> have a look here https://elixirforum.com/t/phoenix-v1-3-0-rc-0-released/3947
20:49 <Vynlar> Ah, the archive name changed. Thanks for the help stephen
20:49 <stephen_m> you need to download the new archive `mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez`
20:49 <stephen_m> and also phx.new -- not phoenix.new
20:51 Ioyrie joined
20:55 xtagon joined
20:58 Uniaika joined
21:21 zoldar joined
21:22 polymetis joined
21:28 hahuang61 joined
21:30 fowlduck joined
21:35 chavito joined
21:35 <mrus> Does anyone have an easy example of how to write a struct like %Plug.Conn{}, that allows piping through own functions? E.g. myStruct |> functionInside. I don't seem to get it working.
21:37 <Uniaika> mrus: what do you mean "own functions"?
21:37 <Uniaika> structs contain data, not functions
21:38 <iFire> well can you do a fn x -> [x] end inside of a struct?
21:38 <iFire> I think you can.,
21:38 <benwilson512> iFire: struct keys can hold arbitrary values sure
21:39 <benwilson512> including anonymous functions
21:39 <benwilson512> but it seems to me more likely that mrus is looking for something like a method and is confused
21:39 <mrus> Uniaika: but the module that "defstruct" that struct contains functions. From what I saw in https://github.com/elixir-lang/plug/blob/91b8f57dcc495735925553bcf6c53a0d0e413d86/lib/plug/conn.ex it is somehow possible to use these methods for the pipeline for "conn", which is only the struct itself, isn't it?
21:41 <Uniaika> uh
21:41 <benwilson512> mrus: structs are not objects, they do not have methods. If you want to pass a struct to a function in the module that the struct was defined you just do so like a regular function call
21:41 <benwilson512> ie
21:41 <benwilson512> conn |> Plug.Conn.some_function
21:41 <Uniaika> mrus: I don't see what you're talking about
21:41 <Uniaika> which line?
21:43 <iFire> conn |> resp(status, body) |> send_resp() ?
21:43 <mrus> benwilson512: hm, I really am confused, yes. Because, look, in my code I can simply write: conn |> put_status(200). And apparently, put_status is a function in :368 ( Uniaika ). How come I don't need to write conn |> Plug.Conn.put_status then?
21:43 <iFire> do you understand how |> works?
21:43 <benwilson512> ah
21:44 <benwilson512> mrus: the Plug.Conn module has been imported
21:44 <Uniaika> yeah
21:44 <benwilson512> mrus: http://elixir-lang.org/getting-started/alias-require-and-import.html#import
21:44 <mrus> ah!
21:44 <mrus> those small details. Thanks, I'll try to import my module then. :)
21:56 gvaughn joined
21:57 gvaughn_ joined
21:58 sfbw joined
22:01 asabil joined
22:18 duane joined
22:18 sfbw joined
22:27 steffkes joined
22:28 jkreeftmeijer joined
22:31 fowlduck joined
22:32 kronicdeth joined
22:36 Ioyrie joined
22:39 jerel joined
23:05 polymetis joined
23:25 raycoll joined
23:26 polymetis joined
23:26 jerel joined
23:29 hahuang61 joined
23:30 jkreeftmeijer joined
23:32 fowlduck joined
23:32 claudevandort joined
23:36 sfbw joined
23:47 bitshift joined
23:55 zv joined