Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 22:45
    Blacksmoke16 synchronize #12966
  • 12:51
    straight-shoota closed #12224
  • 12:51
    straight-shoota closed #13034
  • 12:15
    straight-shoota milestoned #12921
  • 12:15
    straight-shoota milestoned #12921
  • 10:44
    straight-shoota edited #12921
  • 02:39
    cyangle synchronize #12921
  • 01:08
    cyangle synchronize #12921
  • 01:08
    cyangle synchronize #12921
  • Feb 03 22:11
    straight-shoota labeled #12794
  • Feb 03 22:11
    straight-shoota assigned #12794
  • Feb 03 22:07
    straight-shoota synchronize #12959
  • Feb 03 21:38
    straight-shoota milestoned #12983
  • Feb 03 21:38
    straight-shoota milestoned #12983
  • Feb 03 17:37
    straight-shoota milestoned #13045
  • Feb 03 17:37
    straight-shoota milestoned #13045
  • Feb 03 16:49
    straight-shoota review_requested #13045
  • Feb 03 16:49
    straight-shoota review_requested #13045
  • Feb 03 16:49
    straight-shoota demilestoned #13045
  • Feb 03 16:49
    straight-shoota demilestoned #13045
Jonathan Silverman
@mixflame
gonna take a break and then i'll post man it, the feature is cool, i won't reveal it yet but i think you'll like it :D
if i don't have to apologize for a rude banner ad a fan bought (automagically) and i didn't remove but i had to change the rules of the uploader lol
similar uploader for this feature tho
me
@me:ky.rs
[m]
just a wild guess from glancing at their api + all the api madness ive seen out there: maybe put formdata.field("type", "dtg") as the first field?
Jonathan Silverman
@mixflame
ok! i will try that
From IRC (bridge bot)
@FromIRC
<Guest59> Hi
Ali Naqvi
@naqvis
Hi
From IRC (bridge bot)
@FromIRC
<oz> v
<oz> oops, sorry. Wrong window.
G. Gibson
@mistergibson:matrix.org
[m]
is there a source build path for the arm64 arch?
I've got a Raspberry Pi 400 running Ubuntu and would like to add crystal
From IRC (bridge bot)
@FromIRC
<straight-shoota> You can cross compile from a x86 system
<straight-shoota> @mistergibson ^
Daniel Worrall
@Daniel-Worrall
I've got a docker image of arm64 alpine https://hub.docker.com/r/danielworrall/crystal
Daniel Worrall
@Daniel-Worrall
Can either use it in rpi docker, or use it to build for ubuntu without cross compile
Daniel Worrall
@Daniel-Worrall
Okay, I don't have a Comp Sci background, so hopefully this isn't a dumb question. Would a binary cross compiled result in the same binary compiled locally assuming they're both static/release/etc/source version/target version
G. Gibson
@mistergibson:matrix.org
[m]
the arm procedure didn't work for me -- I'll keep trying. Any idea when an official arm64 build will be forthcoming?
Daniel Worrall
@Daniel-Worrall
If you check out the dockerfile, you can see the usual hardships with cross-compiling, specifically the compiler. libcrystal.a for example, which is being removed in future crystal builds
Also uses alpine to avoid problems with dynamic linking
From IRC (bridge bot)
@FromIRC
<straight-shoota> > Would a binary cross compiled result in the same binary compiled locally assuming they're both static/release/etc/source version/target version
<straight-shoota> Yes, should have the same result AFAIK
<straight-shoota> Code is generated by LLVM and that should operate the same way, whether it's building for the native architecture or a different one
Daniel Worrall
@Daniel-Worrall
So, I had an answer in the crystal discord. Reproducability (byte-for-byte) is a complicated issue, but the programs will be "the same"
Isaac Sloan
@elorest
Is there a better way to do line 2 of this? A way to take advantage of the fact that the compiler already knows what type the value is supposed to be.
https://carc.in/#/r/bb91
Kirk Haines
@wyhaines

@elorest: I don't know if this qualifies as "better"....

class Array
  def t
    T
  end
end

arr = Array(Hash(String, String | UInt64 | Int64 | Float64)).new
arr << arr.t.new

It's shorter, but calling the method that was added to Array #t is not particularly clear, and it is dependent on implementation details, but it does take advantage of the type of the array already being known. It could maybe be made less objectionable with:

class Array
  def add_new_value(*args)
    self << T.new(*args)
  end
end

arr = Array(Hash(String, String | UInt64 | Int64 | Float64)).new
arr.add_new_value

Or something kind of similar to that.

Generally, reopening standard lib types to add things is risky business, especially when they depend on other implementation details.
Isaac Sloan
@elorest
@wyhaines Yeah I generally try to avoid that. I was hoping there was something more general with types and aliases. Thanks though.
Sung-Chul Lee
@sclee15
Will CrystalConf unvail videos on YouTube? I am a Crystal user from South Korea. Since the event time starts up at 12AM in my timezone. I cannot attend the live event.
Kirk Haines
@wyhaines

I don't know of any standard method that gives you the type that an array stores, unless you go and create one yourself as above.

You could finagle something with a macro and typeof, which might also be reasonable if you are repeating the above pattern A LOT, but it also won't be particularly pretty in implementation).

Ali Naqvi
@naqvis
1 reply
From IRC (bridge bot)
@FromIRC
<yxhuvud> @wyhaines: typeof(array.first), but yes, it is not super pretty.
3 replies
From IRC (bridge bot)
@FromIRC
<yxhuvud> hrrm. Monkeypatching certain things would be easier if kernel.cr didn't execute as much directly in the top scope. :⁠(
ddd
@Dan-Do
Can we spawn fibers on GPU instead of CPU?
George Dietrich
@Blacksmoke16
no
i remember seeing a shard that allowed using GPU for stuff, but not sure if it's applicable here
ddd
@Dan-Do
:thought_balloon:
thinking :)
ddd
@Dan-Do
okay, can we do this?
done = Channel(Nil).new
spawn do
  call_next(context)
ensure
  done.send nil
end
select
when done.receive
  # print content
when timeout(34.seconds)
  # how to print stack trace to investigate which code causes long processing
  raise "Server could not process_request in 34 seconds"
end
George Dietrich
@Blacksmoke16
for what reason?
ddd
@Dan-Do
I don't know it is because of db, or pooling or business logic processing...
the call_next(context) is more or less like your Athena's Controller
Ali Naqvi
@naqvis
@Dan-Do there is no way, timeout will happen on channel, so it got no relation with any specific fiber
George Dietrich
@Blacksmoke16
not entirely, thats more of how the other frameworks work. I.e. an Array(HTTP::Handler)
Ali Naqvi
@naqvis
what you need is detailed logging inside your logic, so that you can capture detailed information and see what is happening or what is causing the delay
ddd
@Dan-Do
Ok I will go with logging. Can I narrow the log by just logging the fibers which has running time longer than ex 30.seconds
I don't see any method like Fiber.current.running_time
Ali Naqvi
@naqvis
no