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
moe
@moe:busyloop.net
[m]
but now it answered:
Yes, it looks like you would need to build Crystal from source in order to use the interpreter. You can do this by cloning the Crystal repository and running the make command. Alternatively, you can try to find a pre-built package that includes interpreter support.
maybe it's reading this room hmm.
George Dietrich
@Blacksmoke16
:mag:
moe
@moe:busyloop.net
[m]
why is your answer different now from when i asked the first time?
I apologize if my previous response was incorrect. After researching the issue further, it looks like the pre-built Crystal package does not include interpreter support by default. In order to use the interpreter, you would need to build Crystal from source or find a pre-built package that includes interpreter support. My previous response may have been based on incorrect information or a misunderstanding of the question. Again, I apologize for any confusion or inconvenience this may have caused.
jfc...
Ali Naqvi
@naqvis
that's pretty cool
moe
@moe:busyloop.net
[m]
how exactly did you research it further?
I researched the issue by looking at the Crystal documentation and other online resources, as well as checking the available pre-built packages for Crystal on Ubuntu. This allowed me to gain a better understanding of how the interpreter support is included in Crystal and what options are available for using it on Ubuntu.
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