Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:00
    Blacksmoke16 labeled #11772
  • 00:00
    Blacksmoke16 labeled #11772
  • Jan 26 23:43
    asterite closed #11772
  • Jan 26 23:13
    dinko-pehar labeled #11772
  • Jan 26 23:13
    dinko-pehar opened #11772
  • Jan 26 22:27
    RespiteSage synchronize #11771
  • Jan 26 22:03
    RespiteSage synchronize #11771
  • Jan 26 21:51
    straight-shoota edited #11771
  • Jan 26 21:50
    straight-shoota labeled #11771
  • Jan 26 21:50
    straight-shoota labeled #11771
  • Jan 26 18:19
    RespiteSage opened #11771
  • Jan 26 16:29
    FnControlOption synchronize #11476
  • Jan 26 14:11
    straight-shoota labeled #11770
  • Jan 26 14:11
    straight-shoota labeled #11770
  • Jan 26 14:11
    straight-shoota opened #11770
  • Jan 25 22:00
    FnControlOption synchronize #11476
  • Jan 25 21:09
    Blacksmoke16 labeled #10979
  • Jan 25 20:50
    straight-shoota closed #10979
  • Jan 25 20:42
    straight-shoota edited #11769
  • Jan 25 20:42
    straight-shoota labeled #11769
didactic-drunk
@didactic-drunk
@aaaScript 1) Are you using -Dpreview_mt? 2) After .close what is the socket listen state? Can you check with netstat -ln?
aaaScript
@aaaScript
I am not. Also after running netstat the socket is still in a LISTEN state.
didactic-drunk
@didactic-drunk
Are you closing the socket directly or via http.close?
If you're closing the socket directly the bug is fixed in master
aaaScript
@aaaScript
I'm doing it via http.close. I'll try to dissect it some more or play with different ways of closing it.
didactic-drunk
@didactic-drunk
Before and after close
p http.@sockets.map(&.closed?)
p http.@sockets # or
Quinton Miller
@HertzDevil
anyone want to try out compiler-explorer/compiler-explorer#2732 locally
Ali Naqvi
@naqvis
Thank you @HertzDevil :thumbsup:
needing some help here
aaaScript
@aaaScript

Before and after close

p http.@sockets.map(&.closed?)
p http.@sockets # or

@didactic-drunk it's actually returning empty arrays for me before and after. It's kind of odd. Maybe something is happening after the #listen method that is causing some issue?

# Before Close
[]
[]
# After Close
[]
[]
didactic-drunk
@didactic-drunk
@aaaScript Empty @sockets explains why close doesn't work. p @sockets before & after bind & listen(). The array probably gets nuked after listen or it wouldn't accept connections at all
Rishav Sharan
@rishavs
does anyone here uses Sublime Text 4 for crystal dev work? How is the IDE support on sublime. I see that the sublime plugin calls out support for only 2/3 and has fairly slow development.
I am having issues with VS Code and was thinking of trying out alternatives
From IRC (bridge bot)
@FromIRC
<Guest12> Hi all. I am wondering if anyone has a suggestion for creating cross platform UI. I need to target Android specifically so I thought web base would be logical. Although I don't want to touch html/CSS etc. I was hoping there would be a way to make, say imgui, accessable to an android client via http or the like.
<Guest12> Or if any of the current web frameworks for crystal have a built in UI builder that is able to be constructed from within crystal.
From IRC (bridge bot)
@FromIRC
<jhass[m]> you gonna have a hard time with crystal there right now honestly, also because for Android 32 bit ARM is still a relevant target and not even our 64 bit ARM support is in perfect shape
<jhass[m]> Have a look at Flutter maybe
Chris Watson
@watzon
@rishavs VS Code currently has the best Crystal support. It's not stellar, but that's more a lack of a decent language server than anything.
From IRC (bridge bot)
@FromIRC
<ua_> he waited whole 6.5 minutes lmao
George Dietrich
@Blacksmoke16
hm?
From IRC (bridge bot)
@FromIRC
<ua_> i mean Guest12
<ua_> and he should just use react / react native if anyone cares about answer to his question lol
Daniel Worrall
@Daniel-Worrall
Oh, did he leave the irc?
From IRC (bridge bot)
@FromIRC
<ua_> no html/css sure, sadly its the world we live in
Chris Watson
@watzon
He said he didn't want to touch HTML/CSS
From IRC (bridge bot)
@FromIRC
<ua_> yeah
Chris Watson
@watzon
Flutter is the way imo
Daniel Worrall
@Daniel-Worrall
Flutter is nice
Rishav Sharan
@rishavs
flutter is indeed his best bet
George Dietrich
@Blacksmoke16
just return JSON
who needs a UI
Chris Watson
@watzon
++
UIs are for chumps
George Dietrich
@Blacksmoke16
ascii art formatted tables
Chris Watson
@watzon
Just emulate VIM
Rishav Sharan
@rishavs
just hire mimes to read the json and act on it
aaaScript
@aaaScript

@aaaScript Empty @sockets explains why close doesn't work. p @sockets before & after bind & listen(). The array probably gets nuked after listen or it wouldn't accept connections at all

@didactic-drunk It returns socket output after bind_tls and listen as expected. However, it just seems to get wiped like you mentioned. It's kind of weird. I'm not overwriting the object or anything.

ddd
@Dan-Do
@Guest12 you can try Mint
Quinton Miller
@HertzDevil
libpcre reached end-of-life
Ali Naqvi
@naqvis
log back ago, I commented to migrate to pcre2, but ...
https://github.com/crystal-lang/crystal/issues/8199#issuecomment-533171075
Alex Kampa
@alex-kampa
h = Hash(String, String | Hash(String, String)).from_json(jmsg)

results in a compile-time type of

(Hash(String, Hash(String, String) | String) | Nil)

which measn that h.keys throws an error. How can I force h to be a hash?

ie never Nil
Is using is_a? the only way?
George Dietrich
@Blacksmoke16
where is the nil coming from?
Alex Kampa
@alex-kampa

So I simply added this to convince the compiler:

h = h.nil? ? Hash(String, String | Hash(String, String)).new : h

I would guess the nil is because the initial "h = ..." assignment is inside a begin rescue end

Daniel Worrall
@Daniel-Worrall
Yes, you need to compile time check nil.
You can do h ? not_nil_here : nil_here
which is shorthand for if h etc.
This works since it is truthy when not nil
I'm unsure how this works with compile type of Bool | Nil, but I guess it would be true only in the first branch and false | nil in the second