Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 20 20:01
    beta-ziliani milestoned #12033
  • May 20 19:13
    beta-ziliani milestoned #12040
  • May 20 18:57
    beta-ziliani milestoned #11984
  • May 20 18:50
    beta-ziliani review_requested #11972
  • May 18 13:16
    hugopl closed #12062
  • May 17 20:20
    Blacksmoke16 synchronize #12044
  • May 17 18:19
    straight-shoota edited #11947
  • May 17 18:19
    straight-shoota milestoned #11947
  • May 17 18:18
    straight-shoota closed #11971
  • May 17 18:18
    straight-shoota closed #11970
  • May 17 17:21
    HertzDevil labeled #12063
  • May 17 17:21
    HertzDevil labeled #12063
  • May 17 17:21
    HertzDevil labeled #12063
  • May 17 17:21
    HertzDevil opened #12063
  • May 17 16:29
    HertzDevil labeled #12062
  • May 17 13:50
    hugopl opened #12062
  • May 17 13:50
    hugopl labeled #12062
  • May 16 19:05
    lbguilherme synchronize #11947
  • May 16 17:29
    straight-shoota milestoned #11971
  • May 16 17:15
    straight-shoota closed #12038
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?
<holst> say you do docker inspect <container> there might be a lot of data in there which is mostly useles to the application that did the query.
<holst> @straight-shoota: the generated APIs are by the project maintainers (obviously not generated for crystal)
<straight-shoota> I don't follow what your asking about
<straight-shoota> I believe you have assumed some implicit context, but it does not communicate
<holst> thats the complete output for a docker inspect
<straight-shoota> yes, I got that. Still don't know what your problem is
<holst> If I were to implement a complete class description for the entire response I would just not use crlang for that
<straight-shoota> y not?
From IRC (bridge bot)
@FromIRC
<holst> Useless work. I do not have any need for the code that talks about the Network parameters say. So why would I write code for it