non-aristotelian has quit [Quit: non-aristotelian]
non-aristotelian has joined #crystal-lang
johndescs has quit [Ping timeout: 268 seconds]
johndescs has joined #crystal-lang
Renich has left #crystal-lang [#crystal-lang]
Renich has joined #crystal-lang
<FromGitter>
<proyb6> I want to try if I could replace certain string of bytes in all occurrence ⏎ ⏎ "Apple orange apple".to_slice
ua has quit [Ping timeout: 250 seconds]
ua has joined #crystal-lang
akaiiro has quit [Ping timeout: 250 seconds]
akaiiro has joined #crystal-lang
rohitpaulk has joined #crystal-lang
jemc has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
DTZUZU has quit [Quit: WeeChat 2.2]
DTZUZU has joined #crystal-lang
lvmbdv has quit [Quit: WeeChat 1.5]
lvmbdv has joined #crystal-lang
<FromGitter>
<Coalpha> Hello all. "https://crystal-lang.org/api/0.27.0/" is blocked at the network level at my school. Is there any way that I can save a copy of these pages on my computer?
<FromGitter>
<bararchy> is there a way to disable the trace under the help output?
ashirase has joined #crystal-lang
<jokke>
omg i didn't know devdocs existed.
<jokke>
mind blown
<FromGitter>
<dscottboggs_gitlab> @Coalpha on my computer the documentation is stored at `/usr/share/doc/crystal/api/index.html` Seems a little silly to block documentation, but maybe they just whitelist? that sucks dude.
<FromGitter>
<j8r> Before it was done with `puts help` and `exit` instead of raise, but this wasn't testable and not flexible (can't change the stdout)
<FromGitter>
<drum445> Anyone know why I might be getting this on my server when running a release binary? ⏎ ```./crystal_rest: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by ./crystal_rest)```
<FromGitter>
<f1refly_gitlab> I know about the used datatypes, i was just confused about the way the programs parameters were "described" in his sourcecode
<FromGitter>
<j8r> undertheground it's a macro that iterates on this values
<FromGitter>
<bew> @proyb6 define good :) what do you need?
<FromGitter>
<f1refly_gitlab> I thought he'd tried to create a class named 'Clicr' and wasn't aware that it's a shard he was using
<FromGitter>
<f1refly_gitlab> Sorry
<FromGitter>
<f1refly_gitlab> @j8r That shard looks incredibly useful, great job!
<FromGitter>
<j8r> @f1refly_gitlab thanks. Little example to show what's done https://carc.in/#/r/5mv8
<FromGitter>
<f1refly_gitlab> yeah, thank you :)
jemc has joined #crystal-lang
jemc has quit [Client Quit]
jemc has joined #crystal-lang
<FromGitter>
<greenbigfrog> I'm somehow running into ```gmp: overflow in mpz type ⏎ Program received and didn't handle signal IOT (6)``` when trying to divide `10_big_d / 1_big_d` ⏎ I can't repro elsewhere though...
<jokke>
any idea where this error might come from? Failed to raise an exception: END_OF_STACK
<FromGitter>
<redcodefinal> The issue is that `data_sock` blocks using `data_sock.receive`, and won't release the fiber when shutting down the server, so if I try to shut it down and restart it the sockets won't bind.
<FromGitter>
<redcodefinal> On line 39 it closes the server, it could have only gotten to that point if the socket closed right? Even if the socket was in the middle of a blocking receive it should have killed the socket and caused an exception.
<FromGitter>
<redcodefinal> I was hoping I could find an answer similar to Ruby's `recv_nonblock` which produces a `Errno::EWOULDBLOCK.`
<FromGitter>
<redcodefinal> Maybe there is a way to specifically shut down a Fiber? I noticed spawn can take a `name : String`. Is there any way to search through or capture the fiber in a variable?
<FromGitter>
<vladfaust> I'm sorry, I don't know that
<FromGitter>
<redcodefinal> I didn't see anything about a `recv_nonblock` style feature in `IO`, `Socket`, or `UDPSocket`
Renich_ has joined #crystal-lang
Renich has quit [Ping timeout: 272 seconds]
Renich_ is now known as Renich
<FromGitter>
<redcodefinal> @kinxer I'm looking in the docs and found `Fiber#resume` and `Fiber#run`. No docs on them. What do they do? It seems like when you use either of them it ignores every `Fiber.yield` call inside the spawn block.
<FromGitter>
<bew> well, no docs on them because you're not suppose to use them directly
<FromGitter>
<redcodefinal> Ah I see
<FromGitter>
<bew> there is no `Fiber#close` yet, but I remember reading a discussion about it not so long ago, don't remember the results though
<FromGitter>
<bew> somewhere in the multithread preparation PRs
<FromGitter>
<bew> iirc
<FromGitter>
<redcodefinal> I'll take a look around the PRs and see what people have come up with.
<FromGitter>
<redcodefinal> The best solution right now is kind of a dumb one
<FromGitter>
<redcodefinal> Instead of trying to get a nonblock recv or killing the fiber, instead I'll just send \x00 to the socket which will unblock it.
Renich_ has joined #crystal-lang
Renich has quit [Ping timeout: 250 seconds]
Renich_ is now known as Renich
<FromGitter>
<redcodefinal> Wow even after closing the port, killing the fibers behind them, it still says I can't rebind the port :<
<FromGitter>
<redcodefinal> Ok I fixed it and I'm not sure why lol
rohitpaulk has quit [Ping timeout: 268 seconds]
Renich has quit [Read error: Connection reset by peer]
Renich has joined #crystal-lang
<FromGitter>
<greenbigfrog> Is it intentional that something like ` while (a, b = true) && true == false` fails with `unterminated parenthesized expression`?
<FromGitter>
<bew> Hum.. The error is misleading
<FromGitter>
<bew> But it should error something
<FromGitter>
<bew> What's that `a` doing here?
Renich has quit [Read error: Connection reset by peer]
Renich has joined #crystal-lang
<FromGitter>
<greenbigfrog> this is just an example
<FromGitter>
<kinxer> Are you trying to assign `a` and `b` to `true`?
<FromGitter>
<kinxer> @redcodefinal If you figure out what was wrong, I'd be interested to know what it is. No worries if you don't figure it out, though.
<FromGitter>
<greenbigfrog> `while (div, mod = value.divmod(10)) && mod == 0` is what I was actually doing...
<FromGitter>
<kinxer> Extract the `while` condition to a method, maybe?
<FromGitter>
<kinxer> I assume `#divmod` is returning twice, and it seems like there should be some error when testing the truthiness of multiple return values.
Renich_ has joined #crystal-lang
Renich has quit [Ping timeout: 250 seconds]
Renich_ is now known as Renich
<FromGitter>
<bew> @kinxer it does not return twice, it returns a tuple
<FromGitter>
<kinxer> Oh. Which should be truthy, yes?
<FromGitter>
<bew> Not sure you can 'unpack' a tuple like that in an inline way like this, for example what should be the return value of this expression?
<FromGitter>
<jemc> Are there any other language projects in the crystal community that, like mine, are using crystal to compile LLVM? If so, I might like to peek at some of how they're handling certain things
<FromGitter>
<jemc> So far Crystal + LLVM has been a really nice experience, other than a few pain points that there might be existing solutions to.
<FromGitter>
<jemc> I imagine that being self-hosted has really sanded a lot of the rough edges off the LLVM library, since I've been impressed so far