HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 252 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 250 seconds]
return0e has quit [Ping timeout: 250 seconds]
return0e has joined #crystal-lang
Creatornator has joined #crystal-lang
<FromGitter>
<johnpyp> Is there a way to set an index outside the bounds of an array, filling the intermediate values with a default value?
yukai has quit [Ping timeout: 265 seconds]
yukai has joined #crystal-lang
<FromGitter>
<Daniel-Worrall> I can think of an easy way to make a new array with that
_whitelogger has joined #crystal-lang
ht_ has joined #crystal-lang
<livcd>
tenebrousedge: that looks awesome
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
ht_ has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
ur5us_ has joined #crystal-lang
yukai has quit [Ping timeout: 265 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 246 seconds]
<FromGitter>
<yxhuvud> @johnpyp someone is doing aoc I see :)
ur5us__ has joined #crystal-lang
ur5us_ has quit [Ping timeout: 245 seconds]
<foxxx0>
is there a way to see how many values are left in channel?
<FromGitter>
<lbarasti> From the top of my head, @foxxx0 not in the Channel's public API, that I know of.
<FromGitter>
<lbarasti> Looking at the implementation of Channel, you might find some hacky way of exposing that information, though
<FromGitter>
<lbarasti> Right, there is an instance variable of type `Deque` called `@queue` that holds the received values until they are processed
<FromGitter>
<lbarasti> It's private - and that makes sense because you don't want people to fiddle with it
<FromGitter>
<lbarasti> You might also want to look into the `@senders` Deque, which lists all the sender's waiting for a spot in the `@queue` to free up
<foxxx0>
currently i'm only spawning a single fiber but i don't know how much it will send back
<foxxx0>
so i don't know how many times i have to call #receive in the parent
<FromGitter>
<lbarasti> I see. You will often see the following pattern to consume from a channel
<FromGitter>
<lbarasti> ``````
<livcd>
Are there any benchmarks for parallelism against Go ?
<FromGitter>
<lbarasti> this is because typically the number of values that will be sent through cannot be known - think of a web app, for example, or an interactive terminal app
<foxxx0>
i've worked around it by not only returning the fiber's id on the control channel but instead returning a Tuple(Int32, Int32) with {@id, @sent_items} so i know how many #receive calls i need to make
<FromGitter>
<lbarasti> cool, mind that relying on `.close` has the upside that the closure will be broadcast to all the receiving fibers
<FromGitter>
<lbarasti> in case you have multiple workers reading from a single channel
<foxxx0>
good to know, thanks
<foxxx0>
can i still #receive the queued elements from a closed channel?
<foxxx0>
i would expect it to raise the closedchannel exception when i try to #receive on a closed channel when *no* elements are left in the queue
<FromGitter>
<firejox> If the channel has buffer, it can receive data until the buffer empty.
<FromGitter>
<tenebrousedge> > But I'm not sure. Some types are immutable and dup and clone should just return self. Others are mutable but are not meant to be cloned, though in generic code you might invoke clone on a series of objects and you'd want that to work.
<FromGitter>
<watzon> Thanks for the link. Commented on that issue. It looks like maybe String just got missed.
<FromGitter>
<watzon> I don't think `String#[range : Range]` actually copies either. I think it just returns a reference to that same memory
<FromGitter>
<watzon> Damn it, I just want an easy way to allocate a new String, with a completely new Pointer, from another String
<FromGitter>
<Blacksmoke16> would like `String.new str.to_unsafe` do it?
<FromGitter>
<watzon> I don't think String.new actually copies the pointer
<FromGitter>
<watzon> Pretty sure it references the same memory
<FromGitter>
<watzon> `str.to_unsafe.clone` works for getting a unique pointer, but for some reason passing that into a C method fails unless I access it beforehand
<FromGitter>
<watzon> Like with a `puts the_clone`
kevinsjoberg has left #crystal-lang ["Textual IRC Client: www.textualapp.com"]
<FromGitter>
<wontruefree> We were super excited to host @asterite at Chicago Crystal. People who attended loved the talk and hope people here will too https://youtu.be/5rpZOtcCHtk
<FromGitter>
<wontruefree> it was a really good talk
<FromGitter>
<wontruefree> I am going to watch it again after work
sagax has joined #crystal-lang
<hightower3>
so cool!
<FromGitter>
<lbarasti> I'm 30 minutes in and have already learned loads!
Creatornator has joined #crystal-lang
<FromGitter>
<wontruefree> I know right
<FromGitter>
<wontruefree> it is really good
<FromGitter>
<wontruefree> I sent it to some friends of mine that program in python
DTZUZO_ has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<kingsleyh> @lbarasti hey there :)
dwdv has quit [Quit: quit]
<hightower3>
Haha in the talk Ary says "Everything can be solved with time, effort, and patience".
<hightower3>
yeah, just those three, no biggie :)
<FromGitter>
<wontruefree> hahaha
<FromGitter>
<wontruefree> yep
Creatornator has joined #crystal-lang
<FromGitter>
<asterite> @watzon cloning a pointer is just returning itself. Maybe we should remove `clone` from that type
<FromGitter>
<watzon> Maybe. It would be nice to have a simple way to duplicate a pointer though. When I'm wrapping a C library that modifies a buffer, but I want a nicer interface where it actually returns a value and doesn't modify the original I find myself needing that a lot
<FromGitter>
<lbarasti> @kingsleyh 👋
ht_ has quit [Remote host closed the connection]
<FromGitter>
<daya> hi are there any shards that can help with ADFS (SAML 2.0) integration for SSO?
<FromGitter>
<watzon> @daya doesn't seem to be currently
yukai has joined #crystal-lang
<FromGitter>
<watzon> Iirc there was a library that was attempting to be kind of like Passport in the NodeJS space, but for Crystal
<FromGitter>
<watzon> But I can't remember what it was called