Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:15
    postmodern edited #11755
  • 03:43
    postmodern labeled #11755
  • 03:43
    postmodern opened #11755
  • Jan 19 22:41
    straight-shoota edited #11715
  • Jan 19 22:37
    straight-shoota synchronize #11715
  • Jan 19 22:35
    straight-shoota review_requested #11716
  • Jan 19 22:35
    straight-shoota synchronize #11715
  • Jan 19 22:32
    straight-shoota synchronize #11715
  • Jan 19 16:05
    yxhuvud synchronize #11754
  • Jan 19 11:58
    yxhuvud opened #11754
  • Jan 18 22:28
    straight-shoota closed #11751
  • Jan 18 17:33
    straight-shoota milestoned #11751
  • Jan 18 16:48
    Blacksmoke16 labeled #11753
  • Jan 18 16:42
    yxhuvud labeled #11753
  • Jan 18 16:42
    yxhuvud opened #11753
  • Jan 18 13:52
    straight-shoota synchronize #11751
  • Jan 18 13:34
    HertzDevil opened #11752
  • Jan 18 13:34
    HertzDevil labeled #11752
  • Jan 18 13:34
    HertzDevil labeled #11752
  • Jan 18 13:34
    HertzDevil labeled #11752
George Dietrich
@Blacksmoke16
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
ddd
@Dan-Do
I have an array of UInt32, I want to compress it using snappy which input only accepts Slice(UInt8)
Quinton Miller
@HertzDevil
From IRC (bridge bot)
@FromIRC
<riza> since an iterator#next returns (T || Iterator::Stop) -- is there a pretty way to sanitize that Stop type out of the return values type?
<riza> or does it have to be a case statment
<riza> I'm having an awful time attempting to increment two iterators at once
George Dietrich
@Blacksmoke16
Case or if with is_a should do it
From IRC (bridge bot)
@FromIRC
<riza> case fails me because I have two iterators I need to mutually advance
<riza> this is what I tried, anyway: case ; when a === stop || b === stop ; else ... end
<riza> I'm also noticing tonight that ranges can't be decreasing and I'm a little twinging at that too
George Dietrich
@Blacksmoke16
I'd just use the latter approach then
From IRC (bridge bot)
@FromIRC
<riza> I think I'm just going to abandon iterators entirely and twiddle the bits myself
<riza> I was surprised about the decreasing range but that's what ruby does too so there must be some sort of reason
Ary Borenszweig
@asterite
riza: maybe zip the iterators? ;-)
And for decreasing Iterator you can do x.to(y)
From IRC (bridge bot)
@FromIRC
<xyhuvud> I have a small idea of what riza may be fiddling with :⁠D
Ary Borenszweig
@asterite
Haha, me too :-)
From IRC (bridge bot)
@FromIRC
<xyhuvud> todays exercise was so easy and short the top list server crashed due to load :X
Ary Borenszweig
@asterite
Really? That's great news. I guess I'll be streaming for just a few minutes then. I think Eric puts an easy exercise after a tough one (yesterday wasn't that hard, but you needed to think about a different way to represent things)
ddd
@Dan-Do
How can I tell crystal build to use a single "header only" (.h without .c)?
ddd
@Dan-Do
I made a fake.c
# include "header.h"
But after compiled with gcc -c ... the object file removed two functions. Weird!
From IRC (bridge bot)
@FromIRC
<riza> @asterite oh, great suggestion, thank you
From IRC (bridge bot)
@FromIRC
<holst> I have a couple of observations: Crystal lang needs something that is taggable and searchable; crystal lang is not. crlang vs. #crlang is great ;⁠-)
<holst> Also, I think the Goals of the project are non-orthogonal. In total 6 goals but they can be reduced down to at least 5 or even 4 if we accept the fact that OOP is not a goal in itself
<holst> Have anyone written a good JSON / microservice tutorial for crlang? I think I am struggling a lot with moving from say Python or Javascript to Crlang due to the parsing and typing requirements. I have been looking for some kind of best practice guide for this but I have not found one
<holst> do we really need to define the complete API response univerise in the client application just to "get some job done"? If so it puts a great barrier to writing small client apps that uses a big server API
<holst> case in mind: docker engine API
From IRC (bridge bot)
@FromIRC
<holst> and kubernetes API
<straight-shoota> What do you mean with "complete API response univerise"?
<holst> the generated APIs are completely terrible, 100K LOC monsters
<straight-shoota> What generated APIs? Who generated them and why?