Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 24 18:25
    straight-shoota labeled #11765
  • Jan 24 18:25
    straight-shoota labeled #11765
  • Jan 24 18:20
    FnControlOption synchronize #11476
  • Jan 24 18:06
    aarongodin opened #11765
  • Jan 24 17:42
    straight-shoota synchronize #11563
  • Jan 24 17:39
    FnControlOption synchronize #11476
  • Jan 24 17:05
    asterite closed #11756
  • Jan 24 14:30
    straight-shoota synchronize #11563
  • Jan 23 16:04
    HertzDevil labeled #11764
  • Jan 23 16:04
    HertzDevil opened #11764
  • Jan 23 16:04
    HertzDevil labeled #11764
  • Jan 23 15:34
    HertzDevil labeled #11763
  • Jan 23 15:34
    HertzDevil labeled #11763
  • Jan 23 15:34
    HertzDevil opened #11763
  • Jan 23 15:20
    HertzDevil labeled #11761
  • Jan 23 15:10
    HertzDevil labeled #11762
  • Jan 23 15:10
    HertzDevil labeled #11762
  • Jan 23 15:10
    HertzDevil opened #11762
  • Jan 23 14:22
    Blacksmoke16 labeled #11761
  • Jan 23 13:51
    grepsedawk opened #11761
ddd
@Dan-Do
Edit: I used it wrong. Should be ary2 = [[1,2,3]]
oprypin
@oprypin:matrix.org
[m]
yep, i straight up had to hack into the memory region that stores STDOUT
https://gist.github.com/cec2361269f965985fda49a78a3c80f2
From IRC (bridge bot)
@FromIRC
<yxhuvud> in Ruby there is both $stdout and STDOUT, where the difference is that one is the canonical stdout and one is possible to reassign. perhaps something similar would be a good idea?
Paulo Coghi
@paulocoghi
Has anyone successfully used github.com/naqvis/webview on Linux?
I can't run the simple examples, even after installing the required libs: naqvis/webview#4
Paulo Coghi
@paulocoghi
Since the original library works normally on my machine (compilation and execution of the C, C++ and even Go versions), I will try to recreate the Crystal binding. Wish me luck :smile:
oprypin
@oprypin:matrix.org
[m]
yxhuvud, it would certainly be a good idea, just that there are no globals
From IRC (bridge bot)
@FromIRC
<yxhuvud> perhaps better to build an api for temporary replacement for the three std ios. It may be reasonable to have some minor specializations on those 3.
oprypin
@oprypin:matrix.org
[m]

yxhuvud, it would also hugely help to allow these to be any IO, not only FileDescriptor. almost all of the complexity is also due to that.

https://gist.github.com/cec2361269f965985fda49a78a3c80f2

From IRC (bridge bot)
@FromIRC
<yxhuvud> well they can't be IO::Memory - they need to be backed by a file descriptor.
oprypin
@oprypin:matrix.org
[m]
yxhuvud, they can be IO anything which eventually calls to that FD-backed one
not even necessarily, if you purely want to intercept it
From IRC (bridge bot)
@FromIRC
<yxhuvud> well you'd need a pipe or whatever in between
oprypin
@oprypin:matrix.org
[m]
not for the stdout case
it's all programmatic. any write call gets rewritten to a different write call and that's it
and i know about pipes because i certainly needed them in this latest example
From IRC (bridge bot)
@FromIRC
<yxhuvud> unless you want to keep it compatible wth c extensions or whatever, but yeah
oprypin
@oprypin:matrix.org
[m]
ah yea for stuff that directly accesses STDOUT descriptor then you probably need reopen into a pipe
but i think avoiding a pipe+fiber is a more worthy goal than catering to stuff that bypasses official interfaces
From IRC (bridge bot)
@FromIRC
<yxhuvud> both would probably be nice to have. for example to redirect std output for a c extension to avoid spamming the terminal
From IRC (bridge bot)
@FromIRC
<SamantazFox_> Hello there! How can I force some method override to take over something else?
George Dietrich
@Blacksmoke16
define it after the one you want to override
From IRC (bridge bot)
@FromIRC
<SamantazFox_> the problem is that I want to intercept an exception, but I'd like to not have a duplicate of the stdlib for a single line of code
George Dietrich
@Blacksmoke16
feels hacky to override stuff like this
could you not use a HTTP::Handler for this?
From IRC (bridge bot)
@FromIRC
<SamantazFox_> Idk, tbh
<SamantazFox_> I'm entirely open to suggestions!
<SamantazFox_> " You can use a handler to intercept any incoming request and can modify the response. These can be used for request throttling, ip-based filtering, adding custom headers e.g. <code>"
<SamantazFox_> Hmm, but when is it called?
George Dietrich
@Blacksmoke16
that would work, but also would globally silence both of those exceptions, even if they arent from that specific context in your PR
whats the reason these exceptions are being thrown? would it be better to fix the root cause versus just hiding the issue?
From IRC (bridge bot)
@FromIRC
<SamantazFox_> The root cause is simply the user aborting the page loading
<SamantazFox_> they reach <domain>/some/path and either click on a link or on the "Stop" button near the URL bar while the page is still loading.
George Dietrich
@Blacksmoke16
hmm
From IRC (bridge bot)
@FromIRC
<SamantazFox_> crystal-lang/crystal#9065
<SamantazFox_> Here's the issue about that problem ^
<SamantazFox_> That wouldn't be much of a problem if that didn't fill up the logs every time a user is impatient...
George Dietrich
@Blacksmoke16
could just silence the logs from stdlib http stuff
based on https://github.com/crystal-lang/crystal/issues/9065#issuecomment-613559889, id be curious to see if you can reproduce on a simple endpoint or something
From IRC (bridge bot)
@FromIRC
<SamantazFox_> it doesn't happen with a small payload (it's probably being buffered or something)
From IRC (bridge bot)
@FromIRC
<SamantazFox_> (I've tried to delay the response as proposed here: https://github.com/crystal-lang/crystal/issues/9065#issuecomment-961489274, but the browser doesn't seem to time out for localhost)
From IRC (bridge bot)
@FromIRC
<SamantazFox_> Yep, confirmed: Firefox and Vivaldi don't timeout on localhost.
George Dietrich
@Blacksmoke16
SamantazFox_: reproducible example would be super helpful id say
From IRC (bridge bot)
@FromIRC
<SamantazFox_> I'll see that tomorrow. I'mm too tipsy to do anything rn x)
ddd
@Dan-Do
what's the short syntax to convert Slice(UInt32) to Slice(UInt8)?
Here is mine
size = 100
sl = Slice(UInt32).new(size)
sl.to_unsafe.as(UInt8*).to_slice(size * sizeof(UInt32))
oprypin
@oprypin:matrix.org
[m]
@Dan-Do: convert in what sense? not obvious. could be truncating each number, could be splitting low-endian or big-endian
@Dan-Do: also might be a different answer if this this happens to be UTF-32
if you're looking for "system-endian" then your answer is good