ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.31.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
absolutejam2 has quit [Ping timeout: 276 seconds]
<FromGitter> <ImAHopelessDev_gitlab> Anyone heard from @sdogruyol? I'm worried
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
DTZUZO has joined #crystal-lang
dwdv_ has quit [Ping timeout: 268 seconds]
bougyman has quit [Ping timeout: 264 seconds]
bougyman has joined #crystal-lang
f1refly has joined #crystal-lang
f1reflyylmao has quit [Ping timeout: 265 seconds]
<FromGitter> <ImAHopelessDev_gitlab> https://i.gyazo.com/1bbba86951857621b1ad1c54a0728c71.png πŸ˜†
ht_ has joined #crystal-lang
absolutejam2 has joined #crystal-lang
ht_ has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
absolutejam2 has quit [Ping timeout: 240 seconds]
dwdv_ has joined #crystal-lang
<FromGitter> <ilanpillemer> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dbd54609825bd6bac118067]
<FromGitter> <ilanpillemer> is there a better way of incrementing time?
<oprypin> ilanpillemer, what are u referring to? better than what?
<oprypin> i suppose `t` in this code example is time, then
<FromGitter> <oprypin> ```code paste, see link``` ⏎ ⏎ food for thought mostly [https://gitter.im/crystal-lang/crystal?at=5dbd5d8f9c39821509cbdbd0]
<FromGitter> <oprypin> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dbd5e24a03ae1584f532b5b]
<FromGitter> <oprypin> untested code
absolutejam2 has joined #crystal-lang
<FromGitter> <confact> Does it exist a way for me to create a self-signed SSL or checking a certificate (expiration) and such? If not I will create an issue for that.
<jhass> `openssl ...` :P
<jhass> no I don't think we bind the necessary APIs yet
<jhass> but I think there's a related issue already
<jhass> not sure how usable https://github.com/datanoise/openssl.cr still is, there might be useful work in the forks and in general it might provide a base to work on
alexherbo2 has joined #crystal-lang
return0e has joined #crystal-lang
return0e_ has quit [Ping timeout: 240 seconds]
absolutejam2 has quit [Ping timeout: 240 seconds]
<FromGitter> <didactic-drunk> Are changes to openssl in crystal still accepted or is openssl moving to another shard?
<jhass> I think we didn't really decide that yet
<jhass> personally I would like to see certificate & key management APIs in stdlib
alexherbo26 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 240 seconds]
absolutejam2 has joined #crystal-lang
absolutejam2 has quit [Ping timeout: 268 seconds]
alexherbo267 has joined #crystal-lang
alexherbo26 has quit [Ping timeout: 240 seconds]
alexherbo267 has quit [Quit: The Lounge - https://thelounge.chat]
hightower2 has joined #crystal-lang
<hightower2> Hey silly one, if I have Const = [1,2,3], and vals = [0,1], How do I
<hightower2> How do I make the Const to be [0,1,1,2,3] ?
<hightower2> (I'm trying to avoid manual unshifting of each value, of course)
<FromGitter> <Daniel-Worrall> `Const.concat(vals).sort!`
<hightower2> yes yes, it's not about sorting, just prepending in order
<FromGitter> <Daniel-Worrall> Ahj
absolutejam2 has joined #crystal-lang
<FromGitter> <Daniel-Worrall> I think you have to unshift, regardless
<FromGitter> <ImAHopelessDev_gitlab> Good morning!!
sagax has quit [Ping timeout: 268 seconds]
absolutejam2 has quit [Ping timeout: 240 seconds]
absolutejam2 has joined #crystal-lang
absolutejam2 has quit [Ping timeout: 265 seconds]
<FromGitter> <confact> jhass: Thanks for pointing to that repo, it is closer to what i want but missing checking expiration as i can see. But it might be in source or something. Thanks!
<jhass> hightower2: maybe don't use a constant if the value is not...
<hightower2> it is constant, just depends on some values that are easier to construct separately than cram the lines right in the definition
<jhass> you should be able to call a method from the constant initializer
<jhass> Const = compute_const
<hightower2> ah yes, clearly, that'd work
sagax has joined #crystal-lang
<FromGitter> <Daniel-Worrall> Either something is bugged in crystal alpine ssl, or something is bugged with this dockerfile
<FromGitter> <Daniel-Worrall> Does anyone have a native alpine build?
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
duane has quit [Ping timeout: 265 seconds]
justinmcp has quit [Ping timeout: 246 seconds]
daemonwrangler has quit [Ping timeout: 245 seconds]
daemonwrangler has joined #crystal-lang
justinmcp has joined #crystal-lang
absolutejam2 has joined #crystal-lang
hightower2 has quit [Ping timeout: 240 seconds]
<FromGitter> <christopherzimmerman> Are there every any plans with Crystal to allow overriding the `+=`, `*=`, etc... operators?
<jhass> should already be possible, a op= b just expands to a = a op b
<oprypin> jhass, i think the point is to make `+=` behavior special, e.g. actual mutation rather than reassignment of a new value
<jhass> ugh, I hope we never do that
<jhass> there's something like too much of that kind of stuff
<oprypin> yea
<FromGitter> <tenebrousedge> I don't really get why you would want to, and I'd probably hate seeing that in someone else's code
<FromGitter> <Daniel-Worrall> Are http::client.exec's thread safe?
<jhass> if not that's a bug!
<jhass> but probably safer to not share multiple HTTP::Client instances across fibers for now, especially in multithread preview
<FromGitter> <Daniel-Worrall> I'm having problems with reducing to find reproducible code, and some of it is in spawns.
<FromGitter> <christopherzimmerman> In the numerical library I am working, like 50% of the clock time is spent duplicating data. A very common optimization is overriding those operators to treat mutation differently, rather than just using the expansion and re assigning.
<jhass> and I see no reason to do it really, just make multiple to the same host
<FromGitter> <Daniel-Worrall> It's not on MT for now though
<jhass> yeah actually thinking about it you don't want to send more stuff to the server while waiting for a response
<jhass> so better not share a HTTP::Client instance across fibers
<FromGitter> <Daniel-Worrall> Hmm
<jhass> that'll confuse things when the responses come in mixed
<jhass> if not outright confusing the server
<FromGitter> <Daniel-Worrall> Maybe I could mutex it
<jhass> nah, just make more than one instance
<jhass> if you use the class methods on HTTP::Client you should be good
<jhass> what you're doing there exactly is not very clear from the question
<FromGitter> <Daniel-Worrall> No I know
<FromGitter> <Daniel-Worrall> I walked away from it a bit ago. I'll see if I can ask the right questions tomorrow
<jhass> @christopherzimmerman I'm sure there's other ways to fix it :)
<jhass> worst case going away from overriding standard operators etc and just useing plain old methods
<jhass> I think we do some of that for the Big stuff?
<jhass> mh, no looks like I'm wrong
<FromGitter> <christopherzimmerman> Yea I have it exposed through other methods, but since it’s user facing it might be confusing that a += b is twice as slow as a.add(b, inplace: true)
<jhass> just remove * etc? :)
yashko has joined #crystal-lang
absolutejam2 has quit [Ping timeout: 265 seconds]
absolutejam2 has joined #crystal-lang
<Yxhuvud> or define a + that is destructive, though that would probably surprise people too.
<Yxhuvud> (also, considering the common performance problems using String#+=, I'm not certain it would be worse than the confusion that is inherent in += with allocating things)
yashko has quit [Quit: Leaving]
<FromGitter> <didactic-drunk> Is there a quick way to `memzero` a `StaticArray`?
<FromGitter> <didactic-drunk> Should `OpenSSL::Digest.clone` be `#clone` or `#dup`?
<hightower3> Hey give me just a brief guideline here -- I need to open a binary file and then read bytes from it typically 1 or 2 bytes, little endian format. Which method should I use to open the file and read this type of data from it?
<FromGitter> <didactic-drunk> ```File.open("foo") do |io| ⏎ i = io.read_bytes Int16, IO::ByteFormat::LittleEndian ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5dbe12fb7477946bad1a077e]
<hightower3> ok that's good, thanks