Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:29
    Blacksmoke16 labeled #12530
  • 15:29
    Blacksmoke16 labeled #12530
  • 15:23
    analogsalad edited #12530
  • 15:20
    analogsalad opened #12530
  • 14:17
    asterite edited #12144
  • 11:38
    asterite synchronize #11597
  • 11:23
    zw963 labeled #12529
  • 11:23
    zw963 opened #12529
  • 11:13
    asterite reopened #11597
  • 10:50
    straight-shoota milestoned #12527
  • 10:50
    straight-shoota milestoned #12527
  • 10:47
    asterite closed #11597
  • 10:46
    asterite closed #9052
  • 10:46
    asterite closed #8336
  • 10:45
    asterite closed #10310
  • 10:43
    asterite synchronize #11242
  • 10:43
    asterite closed #11867
  • 10:42
    asterite closed #11868
  • 10:40
    asterite closed #12518
  • 10:40
    asterite closed #12520
John Jansen
@johnjansen
forget i asked … stupid me ;-/
From IRC (bridge bot)
@FromIRC
<RX14> @johnjansen you need to use HTTP::Client.new then set the timeout on that client instance
<RX14> HTTP::Client needs some love to be honest
John Jansen
@johnjansen
yep … didnt think to look first, did i ;-)
From IRC (bridge bot)
@FromIRC
<hightower2> Hey, if I need to write a 16bit unsigned int in little endian order into some buffer, then 1) What buffer do I use? StringBuilder? and 2) How do I write something like that?
John Jansen
@johnjansen
@RX14 might have an answer to that, he was here a little while ago
From IRC (bridge bot)
@FromIRC
<RX14> hightower2, you should look at the write_bytes method on IO
<RX14> String.build yields you an IO instance
<RX14> so you can use that
<RX14> however writing a raw integer to a string is unlikely to be what you want
<RX14> strings shouldn't contain binary data
<RX14> if you're working with binary data, IO::Memory and Bytes should be what you use
<hightower2> @RX14, right, was just about to say that, thanks
Chris Watson
@watzon
Anyone know where stddef.h would come from? I seem to be missing it. Reinstalled clang and gcc already
Never mind, I found it in /usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include, but clang seems to not be picking it up for some reason. I'm trying to use crystal_lib and it keeps telling me /usr/include/sys/types.h:145:10: fatal error: 'stddef.h' file not found
From IRC (bridge bot)
@FromIRC
<hightower2> I am trying to write data to a socket, and invoke some method/callback when the data is actually written out. Is there a built-in way for this?
Doug
@DougEverly
@drosehn see if https://github.com/DougEverly/daemonize.cr works for you
Chris Watson
@watzon
What would the Crystal equivilent of unsigned long be?
Would I do $var_name : Float64?
Zatherz
@zatherz
unsigned long is an integer type
long is, at least on most platforms that crystal targets, Int64
crystal doesn't have things like unsigned, it's separate types, so UInt64
@bararchy @watzon Thanks, I'm gonna use these results for https://gitlab.com/zatherz/magicjson
I'm gonna have an always_ordered option that makes it use force ordered, otherwise I'm gonna use naive w/ reset
Chris Watson
@watzon
Ooh awesome
Good going using GitLab
sevk
@sevk
make crystal as a human language , similar to short english .
Zatherz
@zatherz
what
Chris Watson
@watzon
:confused:
sevk
@sevk
easy++
Chris Watson
@watzon
Anyone know what these would be in a Crystal Lib file?
void numa_init (void);
void numa_uninit (void);
I tried fun numa_init, but it's telling me can't find function numa_init (Exception)
Matias Garcia Isaia
@mgarciaisaia
@watzon doesn't fun numa_init : Void work?
Chris Watson
@watzon
@mgarciaisaia nope. Still says it can't find the function
Oh well, I don't think it's an important one to include
Matias Garcia Isaia
@mgarciaisaia
The Crystal Way™ would be something like:
lib Numa
  fun init = numa_init : Void
  # ...
end
So your code calls Numa.init instead of an ugly, C-like name
Chris Watson
@watzon
Is it possible to wrap static functions? Like https://gitlab.com/procps-ng/procps/blob/master/proc/readproc.c#L89
crystal_lib seems to not like them
Ghost
@ghost~5457d9aedb8155e6700d0c69
good day, Crystalians!
I had a little problem with my PC ... it died...
so, now, I am working on a brand new laptop
it has Fedora 26
and installed crystal
almost everything works... I just got that error when I tried the playground
the package lacks dependencies, probably. You should add the missing ssl lib
Matias Garcia Isaia
@mgarciaisaia
Hi @renich! Yeah, packages don't list dependencies yet :/
sudo dnf -y install openssl-devel may do the trick for you - check https://github.com/crystal-lang/crystal/wiki/All-required-libraries#fedora for more packages than you actually need
@watzon not really that sure about static. May it be something with inline, instead?