<FromGitter>
<Blacksmoke16> @bcardiff can probably drop the `-1` from the end as well iirc?
<FromGitter>
<Blacksmoke16> er nvm
ur5us has quit [Ping timeout: 252 seconds]
ur5us has joined #crystal-lang
alexherbo22 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 246 seconds]
alexherbo22 has quit [Ping timeout: 240 seconds]
<FromGitter>
<christopherzimmerman> Anyone had any luck getting Crystal 0.32.0 from homebrew? I don't think its been updated there yet.
<FromGitter>
<Blacksmoke16> The pr was opened a few hours ago
return0e has quit [Ping timeout: 250 seconds]
return0e has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 265 seconds]
<FromGitter>
<anamba> hmm. i thought i solved my own problem the other day (explicitly forcing HTTP::Client to use IPv4 or IPv6 by using the appropriate kind of IP as the host and setting the Host header manually, but I failed to account for SNI. maybe the answer is to set the `remote_address` property on the HTTP::Request manually before executing it
<FromGitter>
<anamba> ok, now i can't figure out how to execute the HTTP::Request 😆
<FromGitter>
<Blacksmoke16> Should be some class method on http client
<FromGitter>
<anamba> you would think
<FromGitter>
<anamba> aha... there it is. there is a Client#exec
<FromGitter>
<anamba> bonus: used the new built-in `String#presence`
ur5us has quit [Ping timeout: 250 seconds]
ur5us has joined #crystal-lang
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 250 seconds]
knifehits is now known as teardown
ur5us has quit [Ping timeout: 250 seconds]
alexherbo22 has joined #crystal-lang
ht_ has joined #crystal-lang
<FromGitter>
<vlazar> > On a different note... What do you call a Crystal programmer? `Crystaller`? ⏎ ⏎ A `Crystal head`! :D (any Breaking Bad fans out there?)
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
ur5us has joined #crystal-lang
<FromGitter>
<kinxer> Is it normal for math libraries to have `.log` be the natural logarithm? I would've expected it to be log base 10, with `.ln` as the natural logarithm.
<FromGitter>
<tenebrousedge> is it oriented towards some specific type of math?
<FromGitter>
<tenebrousedge> I didn't realize Ruby did that
<FromGitter>
<kinxer> Yeah. I'll admit that my math schooling wasn't extensive, but every time I encountered logarithms, the notation either had explicit bases or treated "log" as the log base 10 (or explicitly stated the base in the text).
* FromGitter
* tenebrousedge shrugs ¯\\_(ツ)_/¯
<FromGitter>
<kinxer> Wikipedia lists `log(x)` as a notation used sometimes for each of base 10, base *e*, and base 2.
<FromGitter>
<kinxer> -_-
<FromGitter>
<kinxer> The documentation for `::Math` could use some loving attention.
<FromGitter>
<kinxer> I'd like to do that myself, but I'd have to look up most of the methods in Ruby or Fortran library docs, and I don't have time for that right now.
<FromGitter>
<tenebrousedge> I am still pondering the wisdom of attaching an `owner_id` to all my models. Pros: simplifies permissions code dramatically, which otherwise would involve traversing various optional and polymorphic relations to find a (guaranteed to exist) `owner_id`. Cons: duplicates this information lots
<FromGitter>
<kinxer> Are you more constricted in runtime or memory?
<FromGitter>
<tenebrousedge> constricted in dev time, and writing complicated joins is hard
<FromGitter>
<kinxer> So probably attaching the `owner_id` to everything is the way to go for now? How difficult of a refactor would that be in the future to change it?
<FromGitter>
<tenebrousedge> Probably: drop the column, write the complicated query. There's probably no danger this field would be exposed to the user
Yxhuvud has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
<FromGitter>
<stergiom> ```code paste, see link``` ⏎ ⏎ ..considering that ^this works in `0.32.0`, I expected the mixin variant to do the same. ⏎ ⏎ @Blacksmoke16 it breaks with `Error: undefined method 'new_from_json_pull_parser' for SomeEntity.class` ... [https://gitter.im/crystal-lang/crystal?at=5df2b7bb2bca3016aa6c6f94]
<FromGitter>
<Blacksmoke16> > ..considering that ^this works in `0.32.0`, I expected the mixin variant to do the same. ⏎ ⏎ They work differently
<FromGitter>
<Blacksmoke16> in this case the method is inherited from the parent
<FromGitter>
<stergiom> yup, I see that now, I went by both working in `0.31.1`
<FromGitter>
<Blacksmoke16> while `include` doesn't include class methods, which is what the constructor is
<FromGitter>
<christopherzimmerman> Is there a way to have a class inherit from another class, and then disallow some of the methods of the base class from being called?
<FromGitter>
<christopherzimmerman> I know I can override them and raise explicitly, but I am wondering if there is a better way.
<FromGitter>
<Blacksmoke16> would have to use some macros
<FromGitter>
<Blacksmoke16> PHP handles this by using private methods, as they arent inherited
<FromGitter>
<Blacksmoke16> but in crystal they are so rip
<FromGitter>
<Blacksmoke16> i think id rather they were not
<FromGitter>
<Blacksmoke16> would give purpose to protected methods as currently they arent much different than private
<FromGitter>
<christopherzimmerman> I can think of a macro that would redefine the method and raise an exception, I think I'd prefer to have it be a compile time thing.
<FromGitter>
<Blacksmoke16> yea that would be the way to do it
<FromGitter>
<Blacksmoke16> using an inherited hook
<FromGitter>
<christopherzimmerman> Maybe I need to just redesign my inheritance a bit and take off the methods on another base class :P
<FromGitter>
<christopherzimmerman> Might be an XY problem altogether.
<FromGitter>
<Blacksmoke16> :shrug:
<FromGitter>
<Blacksmoke16> could be a mixin
<FromGitter>
<Blacksmoke16> if only some types need it
<FromGitter>
<j8r> I struggle to find how using `HTTP::Client` with IOs. I would like to send a json body to a server without creating an intermediary `String`