Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 18 13:16
    hugopl closed #12062
  • May 17 20:20
    Blacksmoke16 synchronize #12044
  • May 17 18:19
    straight-shoota edited #11947
  • May 17 18:19
    straight-shoota milestoned #11947
  • May 17 18:18
    straight-shoota closed #11971
  • May 17 18:18
    straight-shoota closed #11970
  • May 17 17:21
    HertzDevil labeled #12063
  • May 17 17:21
    HertzDevil labeled #12063
  • May 17 17:21
    HertzDevil labeled #12063
  • May 17 17:21
    HertzDevil opened #12063
  • May 17 16:29
    HertzDevil labeled #12062
  • May 17 13:50
    hugopl opened #12062
  • May 17 13:50
    hugopl labeled #12062
  • May 16 19:05
    lbguilherme synchronize #11947
  • May 16 17:29
    straight-shoota milestoned #11971
  • May 16 17:15
    straight-shoota closed #12038
  • May 16 17:15
    straight-shoota closed #12036
  • May 16 17:14
    straight-shoota edited #12038
  • May 16 13:47
    straight-shoota closed #12051
  • May 16 13:47
    straight-shoota closed #12050
Giorgi Kavrelishvili
@grkek
Thats all of it
Other things are useless distractions which were forced upon you for torture
@yxhuvud Same!
j8r
@jrei:matrix.org
[m]
by preparing, you also mean some exercises they want you to do before the interview?
Giorgi Kavrelishvili
@grkek
Nah, just an interview
If they plan on doing some exercises I just say
Kaia Leahy
@tenebrousedge
I mean I have only a loose idea of what a "data engineer" does, and don't know what I'm going to be expected to know
Giorgi Kavrelishvili
@grkek
Send it over the E-Mail and Ill send it over to you once done
j8r
@jrei:matrix.org
[m]
Pretty sure they have an even looser idea of why they want a "data engineer"
the solution can just be to have a precise job sheet
From IRC (bridge bot)
@FromIRC
<yxhuvud> jrei: no, if they want me to solve a reasonably sized problem that is fine. that is different
didactic-drunk
@didactic-drunk

@oprypin:matrix.org I have a few shards (example) that run on limited platforms. Some are POSIX only. One is OpenBSD only. Future ones may be window only. What say you of 2 additional options for shard.yaml?

A platform flag. If it matches the shard is included. If not the shard is automatically pruned.

# For mmap
  platforms: 
  - !windows
  - posix (or)

# For mostly posix shards
  platforms: 
  - !macos
  - posix

A 2nd platform flag with identical semantics should be available for dependencies

  dependencies:
    generic-file-polling.cr:
      platforms:
      - !linux
    inotify.cr:
      platforms:
      - linux

Why both? These options aren't mutually exclusive.

Sometimes the shard author knows it won't work on specific platforms and they can specify them.

Other times the author may choose a more specific solution and wish to exclude a generic shard (see inotify example above). Or they could be working on an newer/older system where a shard specified dependency doesn't work in their particular situation.

oprypin
@oprypin:matrix.org
[m]
@didactic-drunk: it's funny that you're against specifying crystal <2.0 but for specifying unsupported platforms. i guess the difference is that in most cases the author does actually know it won't work on those platforms. however, consider a large number of shards that exist now, -- how often would people be tempted to specify "nope doesnt work on Windows" and then eventually that specification will be the only actual reason why it doesn't work on Windows
didactic-drunk
@didactic-drunk
@oprypin:matrix.org I'd be against specifying !any_platform_unless_the_api_is_broken_or_doesn't_exist
oprypin
@oprypin:matrix.org
[m]
uh sorry I didn't understand that. there are like 4 negations there
didactic-drunk
@didactic-drunk
@oprypin:matrix.org Here's what I have planned (yes a real example). 1) Create mmap (done) which can be used for anonymous memory or mapping a file or a few other uses with platform: posix. Create a windows anonymous memory shard (No mmap equivalent that handles all functions) with platform: windows. Create a generic anon memory wrapper shard that includes both. Create a guard page key holding shard similar to sodium_malloc using the anon memory shard.
oprypin
@oprypin:matrix.org
[m]
well the first three could be just one shard. but that's only for your particular example
there are very many missing features but it seems that for most of the parts of the specification you can't just go adding features onto the existing spec, perhaps a greater overall look at the design would be better
didactic-drunk
@didactic-drunk
I'm against < crystal 2 because it's a guess, probably false and breaks applications for no apparent reason when 2.0.0 is released or forces them to upgrade which may involve API changes or other unpleasantries
oprypin
@oprypin:matrix.org
[m]
I am not convinced of any particular approach at the moment and sorry I won't dive into that topic
I just felt that the postinstall thing in particular would be not controversial
didactic-drunk
@didactic-drunk
The platform flag would be limited use. See the inotify example. Btw this is also based on a real example from ruby gems.
didactic-drunk
@didactic-drunk
While I could make one shard I'd prefer not to. I don't want to maintain the windows version. I may make a windows version if no one else does. Also, platform specific features are sometimes needed (mmap in particular). The anon memory wrapper and guard pages need simple functionality that both platforms support. If I were doing something else with mmap like mapping a file, I can't do that on windows as it uses a completely different API
Which I don't intend to wrap
didactic-drunk
@didactic-drunk
@oprypin:matrix.org Shortened answer. platform as a restriction wouldn't be used with pure portable crystal shards, only platform specific shards. platform as a dependency may be specified to override. See the inotify example. Generic file polling may work everywhere but on linux you may prefer inotify. On BSD eventually kqueue. Although technically those should have their own platform limitations so the dependency limit should only be placed on generic file polling.
I guess that wasn't a shortened answer
ryanprior
@ryanprior:matrix.org
[m]
I'm having trouble casting a type to a more permissive type. For example, suppose I define my type as:
alias PermissiveType = Array(String | Int32) | String
s : PermissiveType = "hello world" #works
ss : PermissiveType = ["hello", "world"] # must be (Array(Int32 | String) | String), not Array(String)
It seems like since PermissiveType is strictly more permissive than Array(String) this cast should be possible - any possible value of that more restrictive type should satisfy the more permissive type.
How do I accomplish that?
Kirk Haines
@wyhaines

@ryanprior:matrix.org What you are running into is that while one can logically look at an Array(String) and see that an Array(String | Int32) can store everything in it, type specifications are very specific, and your type specification is for two things, either an Array(String | Int32), or String, and what you are trying to assign is an Array(String), which is not either of those things.

ss : PermissiveType = Array(String | Int32).new + ["hello", "world"]

That will create an array with a type signature that matches what PermissiveType allows.

Ali Naqvi
@naqvis
^ or provide the type of literal
ss : PermissiveType = ["hello", "world"] of String | Int32
if yo don't provide the type, compiler will infer that as Array(String)
Kirk Haines
@wyhaines
Thanks. My daughter interrupted me to move the van, and you finished for me. :)
Ali Naqvi
@naqvis
:P
Kirk Haines
@wyhaines
@ryanprior:matrix.org are you the current maintainer of crystal-readline? I have a private fork of it that I have been forced to maintain because the mainline lacks proper Crystal 1.0+ support. If I provide a PR, can we get the mainline project updated and a new release built?
ryanprior
@ryanprior:matrix.org
[m]
I'm not the maintainer but that would be useful for me too
Kirk Haines
@wyhaines
OK. I saw a commit from you on the main repo, so I was wondering.
Holden Omans
@kalinon
Anyone know how to build with -Dpreview_mt in the alpine-build docker image?
George Dietrich
@Blacksmoke16
try in the nightly image
3 replies
crystal-lang/distribution-scripts#63 was merged recently but not sure if it's actually in the nightly image atm or if there's another step that needs done to enable it
Holden Omans
@kalinon
oh nice ill try it out
didactic-drunk
@didactic-drunk
Is there a macro or easy way I can store the caller of .newfor reference later in finalize to track potential API misuse? I would prefer easy single line way to add this to any class
Kirk Haines
@wyhaines

@didactic-drunk that complete functionality doesn't exist so far as I am aware, but all of the building blocks exist. Maybe it can be my macro-hacking project of the week to build it.

Right now I am picturing something such as simple as include CallTrace, followed by an annotation on top of any method that one want's to build a call tracing stack for.

The actual call trace would be accessible at any time.

Jonathan Silverman
@mixflame
hello guys... this code pings out on Rizon (Ping Timeout) after it joins the #8chan channel... I asked in #Help on Rizon but I'll post the code here in case anyone wants to try to find the issue.... it has to do with the level of chatting... I suspect I need a "spawn" somewhere. https://gist.github.com/mixflame/e4bc13dd5d9a73af1524b2fe52c430a6
note that rizon is a custom network with special requirements that other networks don't possess.... like pinging on connect... might look wrong for other networks or just be fine... not sure about IRC internals as much as others might be
if you want to use it to build a bot, go ahead, it's based on the irc lib for crystal on github
be aware of the ping issue and if you find a solution let me know
Matthew Berry
@mattrberry
How do you properly case over a runtime type of an object? https://carc.in/#/r/bc3v
George Dietrich
@Blacksmoke16
Matthew Berry
@mattrberry
Ah