Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 07:55
    Tamnac opened #13026
  • Jan 28 21:02
    Blacksmoke16 labeled #13025
  • Jan 28 21:02
    Blacksmoke16 labeled #13025
  • Jan 28 21:02
    Blacksmoke16 labeled #13024
  • Jan 28 21:02
    Blacksmoke16 labeled #13024
  • Jan 28 18:45
    asterite opened #13025
  • Jan 28 16:23
    meatball133 synchronize #13024
  • Jan 28 15:53
    meatball133 edited #13024
  • Jan 28 15:51
    meatball133 opened #13024
  • Jan 28 15:10
    meatball133 ready_for_review #13008
  • Jan 28 13:24
    straight-shoota closed #13014
  • Jan 28 02:34
    Blacksmoke16 labeled #13023
  • Jan 28 02:19
    cyangle labeled #13023
  • Jan 28 02:19
    cyangle opened #13023
  • Jan 28 00:41
    devnote-dev labeled #13022
  • Jan 28 00:41
    devnote-dev opened #13022
  • Jan 27 23:05
    straight-shoota labeled #13021
  • Jan 27 23:05
    straight-shoota labeled #13021
  • Jan 27 23:05
    straight-shoota labeled #13021
  • Jan 27 23:05
    straight-shoota labeled #13021
George Dietrich
@Blacksmoke16
skynet is real
moe
@moe:busyloop.net
[m]
but i'm not on ubuntu, i'm on windows!
If you are using Windows, you will not be able to use the pre-built Crystal package as it is only available for Linux-based systems. In order to use Crystal on Windows, you will need to build it from source by following the instructions on the Crystal website. Alternatively, you can try using a different package manager or pre-built package that is available for Windows. You can also try using a virtual machine or dual-booting to install a Linux-based operating system and use the pre-built Crystal package on that system.
ok i'll stop spamming now. but this thing is crazy 🤯
Beta Ziliani
@beta-ziliani
time for a core team member bot
j8r
@jrei:matrix.org
[m]
beta bot 😄
phil294
@phil294:matrix.org
[m]
Hi! Is it possible to debug binaries with MT enabled? I'm trying to GDB into errors which I presume are caused by GC + GTK + MT, but running with gdb always fails. Current error message is SIGPWR, Power fail/restart, but I think I'have had others too. I am just generally wondering if it's possible to debug multithreading applications.
j8r
@jrei:matrix.org
[m]
Tried with Valgrind?
phil294
@phil294:matrix.org
[m]
no, though I barely even know what it is, I'll test that later. Thanks
From IRC (bridge bot)
@FromIRC
<yxhuvud> sigpwr seems to happen on power failure. I hadn't seen that one before.
azurelmao
@azurelmao
What am I defining the initial capacity for if I can't use it like this?
https://carc.in/#/r/e78e
George Dietrich
@Blacksmoke16
it allocates memory such that it could fit 100 Int32 values
azurelmao
@azurelmao
So in order to skip past indexes I first have to fill the array with some value?
George Dietrich
@Blacksmoke16
there's another overload that allows you to initialize each index to some value if you want
azurelmao
@azurelmao
Yeah ik, I had just hoped there would be a more convienent way to do it
George Dietrich
@Blacksmoke16
more convenient how?
or backing up, what end result are you wanting?
azurelmao
@azurelmao
It's just that I have a class which adds itself to a class var on init
def initialize(@id)
    if id > 0
      @@item_list.insert(@id, self)
    end
  end
so now I have to check whether the id is 0
in order to fill the array
George Dietrich
@Blacksmoke16
are they instantiated in order? i.e. is it possible the first instance has an @id of 10 and the next 1 or is it always going to go in order?
0, 1, 3, ...
0, 1, 2, ...*
azurelmao
@azurelmao
they won't be in order
George Dietrich
@Blacksmoke16
Hash(Int32, self).new then?
azurelmao
@azurelmao
Oh, I haven't thought of that
I'll try it
George Dietrich
@Blacksmoke16
seems like a more reasonable data model if you just want to store objects with a numerical key
azurelmao
@azurelmao

btw, this is unrelated to my previous question I'm just curious, but is there a literal for object instantiation? Something like:

foo = Foo{id: 1}

Which would bypass the initialize method and let you assign the properties by hand

George Dietrich
@Blacksmoke16
no
azurelmao
@azurelmao
I see
George Dietrich
@Blacksmoke16
unless you make everything nilable and do something like:
foo = Foo.new
foo.id = 1
...
but ofc, having a proper constructor is usually the better way
i.e. Foo.new 1 or Foo.new id: 1
azurelmao
@azurelmao
I usually avoid Nilable types, because of the trouble they cause
Anyways, thank you for helping me!
George Dietrich
@Blacksmoke16
np
From IRC (bridge bot)
@FromIRC
<SamantazFox> For anyone interested: I've been doing my Advent of Code in Crystal this year ^^ https://github.com/SamantazFox/AoC-2022
From IRC (bridge bot)
@FromIRC
<riza> SamantazFox: there are a bunch of us, the Discord server has an aoc channel. But I'm over here at github.com/robacarp/advent_of_code/
<riza> a couple more links from the discord https://github.com/hovsater/aoc-crystal
<riza> there are probably many others
<riza> oh we have a leaderboard too....uuuummm
re:fi.64 🏳️‍🌈
@refi64:linuxcafe.chat
[m]
Note that mine is not actually in Crystal 😅
From IRC (bridge bot)
@FromIRC
<riza> oh whoops
<riza> i like that they're on sr.ht
<riza> i keep meaning to set up a gittea or something but ...
re:fi.64 🏳️‍🌈
@refi64:linuxcafe.chat
[m]
sr.ht is definitely pretty nice