ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.30.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
<FromGitter> <Blacksmoke16> is there any use case for serializing null on specific properties vs all or no properties?
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 246 seconds]
chemist69 has quit [Ping timeout: 246 seconds]
chemist69 has joined #crystal-lang
ht_ has joined #crystal-lang
ht_ has quit [Remote host closed the connection]
livcd has joined #crystal-lang
Ring0` has quit [Quit: bb 0_o]
alex`` has joined #crystal-lang
f1reflyylmao has quit [Quit: bye fags]
f1refly has joined #crystal-lang
frojnd has quit [Ping timeout: 244 seconds]
gangstacat has quit [Ping timeout: 276 seconds]
gangstacat has joined #crystal-lang
<FromGitter> <Blacksmoke16> im going with no for now
<FromGitter> <j8r> I'm working on an experimental package manager
<FromGitter> <Daniel-Worrall> Sometimes, what I don't like is how a hash access can return an error on an invalid key instead of returning a default value (like nil) ⏎ Have to do `if hash[key]?`
<FromGitter> <Blacksmoke16> could also use https://crystal-lang.org/api/master/Hash.html#fetch(key,default)-instance-method
<FromGitter> <c-cube> or `fetch` with a block, I think
<FromGitter> <j8r> I got at least 3x times speed up compared to `shards`
<FromGitter> <j8r> `shards install` i mean
<FromGitter> <Blacksmoke16> yea, similar thing, tries to get value with the given key, otherwise use the default value or result of the block
<FromGitter> <tenebrousedge> or you could use a default block
<FromGitter> <Daniel-Worrall> Hmm
<FromGitter> <Blacksmoke16> or even like `value = hash[key]? || "default"`
<FromGitter> <Daniel-Worrall> didn't know about fetch, but I don't think it's as intuitive
<FromGitter> <Blacksmoke16> wouldn't work with false tho, as it would invoke the default
<FromGitter> <j8r> there is a block variant
<FromGitter> <j8r> `h.fetch("foo") { "default value" } # => "bar"`
<FromGitter> <tenebrousedge> or set the default block at initialization
<FromGitter> <tenebrousedge> there are options :)
<FromGitter> <Daniel-Worrall> I can work with this, thanks, but doesn't seem as intuitive as it should be
<FromGitter> <Blacksmoke16> what would you propose instead?
<FromGitter> <Daniel-Worrall> First, #[] would return a default instead of raising
<FromGitter> <c-cube> it's not shocking to me that `x[y]` means you know that `y` is a valid key, like for arrays
<FromGitter> <c-cube> you can define a default block for the whole Hash, @Daniel-Worrall
<FromGitter> <tenebrousedge> or `has_key?` if you really only want to test if it exists
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Hash.html#new(default_value:V,initial_capacity=nil)-class-method and the block variant
<FromGitter> <Daniel-Worrall> `#[]?` is fine for exists
<FromGitter> <tenebrousedge> are you not actually doing anything with the value?
<FromGitter> <Blacksmoke16> if you dont need a bool literal
<FromGitter> <Daniel-Worrall> I am using the value
<FromGitter> <Daniel-Worrall> This isn't something I'm coding right now, but an observation on usage in hopes of better experience
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/7ltw
<FromGitter> <Blacksmoke16> `#[]?` can lead to bugs if the value is false
<FromGitter> <Daniel-Worrall> Oh okay, it's that a hash normally doesn't initialise a default
<FromGitter> <c-cube> unless you specify it in `Hash.new`
<FromGitter> <Daniel-Worrall> yeah, you have to specify
<FromGitter> <Daniel-Worrall> Then my proposal would be that all new hashes return nil on non-existing kety
<FromGitter> <Blacksmoke16> i dont really see the issue tho, array etc works the same way
<FromGitter> <Blacksmoke16> `[]` is known to raise on invalid key/index `[]?` returns nil if it doesnt exist/out of bounds
<FromGitter> <Blacksmoke16> having `Hash#[]` would be even worse as its diff behavior specific to one thing
<FromGitter> <Daniel-Worrall> It's a very different behaviour from Ruby, and arrays are known length
<FromGitter> <tenebrousedge> yes, it's different from Ruby
<FromGitter> <Daniel-Worrall> My problem isn't that it's different, but very different
<FromGitter> <Blacksmoke16> well crystal != Ruby πŸ˜‰
<FromGitter> <Blacksmoke16> just learn to use `[key]?` and boom, same behavior :P
<FromGitter> <Daniel-Worrall> Is this common practice for other compiled langs for raising on an invalid hash key
<FromGitter> <tenebrousedge> it's self-consistent
<FromGitter> <Daniel-Worrall> Well, Array != Hash
<FromGitter> <Blacksmoke16> its the semantics behind how `#[]` works
<FromGitter> <Daniel-Worrall> It's a crystalism then
<FromGitter> <Daniel-Worrall> but pre-1.0, we get to decide what crystalisms get to be
<sorcus> j8r: Great news. Good luck. :-)
<FromGitter> <Blacksmoke16> sure, but idt this aspect would change
<FromGitter> <stronny> types, man
<FromGitter> <tenebrousedge> for a boolean value, you have the predicate method
<FromGitter> <stronny> `a = Hash(K, V).new[x]` will always be V
<FromGitter> <Blacksmoke16> `#[]` returning `nil` would make every value in every hash would be unioned with `Nil`
<FromGitter> <Daniel-Worrall> True
<FromGitter> <Daniel-Worrall> but you still have to test key existence
<FromGitter> <stronny> you can if yuu want
<FromGitter> <stronny> you don;t have to
<FromGitter> <Daniel-Worrall> Type Safe!
<FromGitter> <Blacksmoke16> `if val = hash[key]?`
<FromGitter> <c-cube> @Daniel-Worrall what if you want to store `nil` in a Hash?
<FromGitter> <tenebrousedge> or use `find`
<FromGitter> <c-cube> returning nil on `[]` means you can't know if the key was there
<FromGitter> <c-cube> (ofc `Set(T)` is exactly `Hash(T,Nil)` so it's not just fiction)
<FromGitter> <Daniel-Worrall> Interesting
<FromGitter> <Blacksmoke16> set is more similar to an array than a hash
<FromGitter> <Blacksmoke16> just happens to be implemented using a hash
<FromGitter> <j8r> thanks sorcus.
<FromGitter> <stronny> so you have a O(1 + X) instead of O(N)
<FromGitter> <j8r> I will call it `shred` :Β°
<FromGitter> <j8r> This package manager is mainly meant to make experimentations, in order to improve shards
<FromGitter> <Blacksmoke16> sounds like a plan
<FromGitter> <j8r> without cache, concurrent download of packages is blazing fast :o
<FromGitter> <j8r> I'm too tired to still use shards 0.8.1 :/
<FromGitter> <stronny> any plans to make a dedicated repo by the way?
<FromGitter> <j8r> dedicated repo?
<FromGitter> <j8r> like npm/cargo registry
<FromGitter> <j8r> A command I will implement is `shred install mypackage`
<FromGitter> <j8r> and of course, `shard.yml` and lock could still be used
<FromGitter> <stronny> like rubygems
<FromGitter> <stronny> not wandering around githubs
<FromGitter> <j8r> There is http://crystalshards.xyz/ ?
<FromGitter> <stronny> isn't it just an index? I'm talking artefacts storage
<FromGitter> <j8r> what doe it change?
<FromGitter> <j8r> We can find the package using this site
<FromGitter> <stronny> immutable builds in a central location
<FromGitter> <j8r> This is a bit different then
<FromGitter> <stronny> go's dependency solution has acquired some criticism over the years
<FromGitter> <j8r> What builds?
<FromGitter> <j8r> we are talking about a central registry for source code, right?
<FromGitter> <stronny> gems are also source code
<FromGitter> <stronny> what would also be neat is storing files inside a squashfs and mounting it instead of unpacking
<FromGitter> <j8r> Builds is a very wide project, supporting bsds, musl, glibc, darwin. And static or dynamic linking?
<FromGitter> <stronny> linux only though
<FromGitter> <j8r> static linking is meh (no stack trace)
<FromGitter> <stronny> binary objects go to destribution repos
<FromGitter> <j8r> anyway not planned
<FromGitter> <stronny> cool
<FromGitter> <stronny> just to make myself clear, "builds" refer to a set of .cr files packed into a single file
<FromGitter> <j8r> like a `tar`?
<FromGitter> <j8r> github already does that
<FromGitter> <stronny> why do rubygems exist?
<FromGitter> <stronny> I mean there are reasons, are they relevent for Crystal or no?
<FromGitter> <j8r> back then gitlab, github, etc wasn't as widespread
<FromGitter> <j8r> more people were using their own tools
<FromGitter> <j8r> and also different tools like git, svn, cvs or nothing
<FromGitter> <stronny> nothing ever stopped you from publishing your sources
<FromGitter> <j8r> yes but there were no central places
<FromGitter> <stronny> github is not a central place
<FromGitter> <j8r> Now most of codes are in GitHub and GitLab
<FromGitter> <Daniel-Worrall> Is there a way to log extra attributes that a JSON.mapping has missed?
<FromGitter> <Daniel-Worrall> Like if an API adds more attributes, you can warn
<FromGitter> <Blacksmoke16> you could include https://crystal-lang.org/api/master/JSON/Serializable/Unmapped.html
<FromGitter> <Blacksmoke16> then add an `after_initialize` method that would raise/log something if its not empty
<FromGitter> <Daniel-Worrall> oh, strict: true
<FromGitter> <Blacksmoke16> that would work too if you wanted to not handle it gracefully
<FromGitter> <Daniel-Worrall> alright, thanks
<FromGitter> <Daniel-Worrall> hm, only problem is that the convenience method doesn't allow strict
<FromGitter> <c-cube> @j8r if you make another package manager, make sure it's purely experimental, not competing with shards ;)
<FromGitter> <c-cube> fragmentation is a terrible thing
<FromGitter> <j8r> not really
<FromGitter> <j8r> The purpose is like yarn or IO.js
<FromGitter> <j8r> this is good when there are several projects, but yes not 100 ones
<FromGitter> <nsuchy> I have the following IF-LOGIC: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ it's very long and difficult to read, how could I better express this? [https://gitter.im/crystal-lang/crystal?at=5d84e4ae1998d516956fc58d]
<FromGitter> <Daniel-Worrall> private convinence method :^)
<FromGitter> <c-cube> if they're 100% compatible on the project description front, it's ok
<FromGitter> <nsuchy> @Daniel-Worrall could you show an example?
<FromGitter> <stronny> basically the idea is to break the condition into multiple lines
<FromGitter> <nsuchy> I like the idea of a method
<FromGitter> <nsuchy> thinking of one that returns a hash
<FromGitter> <nsuchy> with the data
<FromGitter> <nsuchy> so I don't have to rewrite the query each time
<FromGitter> <stronny> just `if` with dagling `&&`s look ugly, so another way to do it is to return false early and true in the end
<FromGitter> <Daniel-Worrall> or just newline
<FromGitter> <Daniel-Worrall> ```code paste, see link``` ⏎ ⏎ Ugly? [https://gitter.im/crystal-lang/crystal?at=5d84e59804053c5b3d8fb2e6]
<FromGitter> <stronny> meh
<FromGitter> <stronny> `return false unless user = current_user`
<FromGitter> <Daniel-Worrall> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d84e63a56677e767a29bbd7]
<FromGitter> <j8r> you need backslashes
<FromGitter> <Daniel-Worrall> I think that'd work?
<FromGitter> <stronny> this here has just one condition actually: `service_user.id == user.id`
<FromGitter> <nsuchy> yeah
<FromGitter> <nsuchy> that makes sure you can't pull someone else's virtual machine
<FromGitter> <stronny> all the others check for nils and that's questionable design
<FromGitter> <nsuchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d84e6671998d516956fd39f]
<FromGitter> <nsuchy> Aside from updating the templates, this approach seems to work
<FromGitter> <nsuchy> it's still a bit messy
<FromGitter> <nsuchy> but less than before
<FromGitter> <Daniel-Worrall> You probably want a method on User to check instead
<FromGitter> <nsuchy> The reason we check if the service is disabled in the controller, and not the model is because Staff can pull a user's virtual machine and make changes regardless of if it's disabled, I suppose we could set a flag
<FromGitter> <Daniel-Worrall> or idk
<FromGitter> <nsuchy> this is, at least better than before
<FromGitter> <tenebrousedge> `if user_id = current_user.try(&.id)`
Human_G33k has quit [Quit: Leaving]
<FromGitter> <tenebrousedge> and instead of wrapping the code in an `if`, you might do: ⏎ ⏎ ```hash = { #... } ⏎ hash.values.any?(&.nil?) ? nil : hash``` [https://gitter.im/crystal-lang/crystal?at=5d84e7fae45b6d47322770d4]
<FromGitter> <tenebrousedge> I'd probably think about a `Struct` instead of a `Hash` though
<FromGitter> <nsuchy> I'm probably gonna add more helper methods to the user and service and virtual machine models
<FromGitter> <nsuchy> that can keep the cross reference's inside the models
<FromGitter> <nsuchy> rather than cluttering the controllers
<FromGitter> <nsuchy> that's a huge part of the mess right now
<FromGitter> <tenebrousedge> yeah, that seems best
<FromGitter> <Blacksmoke16> could prob do like
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d84e982a7a5cc473326203f]
<FromGitter> <nsuchy> oh wow nice
<FromGitter> <Blacksmoke16> id test it first, not sure how macro render works with return
<FromGitter> <nsuchy> of course
<FromGitter> <nsuchy> I have git history
<FromGitter> <nsuchy> :P
<FromGitter> <nsuchy> works perfect
<FromGitter> <nsuchy> wow
<FromGitter> <nsuchy> that code looks and works great
<FromGitter> <Blacksmoke16> might be able to combine the first and third return
<FromGitter> <Blacksmoke16> but is more clear this way i guess
<FromGitter> <nsuchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d84ebc6e45b6d4732278c7c]
<FromGitter> <nsuchy> next mess
<FromGitter> <tenebrousedge> `each` >_<
<FromGitter> <nsuchy> I'm not proud of this method
<FromGitter> <nsuchy> ~but it works~
<FromGitter> <tenebrousedge> `client_ids.uniq.compact_map { |cid| BlestaClient.find_by(id: cid) }`
<FromGitter> <Blacksmoke16> couldnt those be like replaced with some `#select` and `#map`?
<FromGitter> <Blacksmoke16> yea like that ^ :p
<FromGitter> <tenebrousedge> `clients.uniq.map(&.user_id).compact_map { |cid| BlestaUser.find_by(id: cid) }`
<FromGitter> <Blacksmoke16> wait why not just do like (pseudo code) `BlestaUser.where("id in user_ids")`
<FromGitter> <Blacksmoke16> then you just do 1 db query and inherently get an array back
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 265 seconds]
return0e has joined #crystal-lang
return0e_ has quit [Ping timeout: 276 seconds]
<FromGitter> <fridgerator> I'm having an issue with Crystal resolving docker host names with an error: `Caused by: getaddrinfo: Temporary failure in name resolution (Socket::Addrinfo::Error)`
<FromGitter> <fridgerator> Docker host name resolution has been an issue with crystal for a while now, has anyone else run into this issue, or have a workaround?
<FromGitter> <Daniel-Worrall> How are you trying to resolve host names?
<FromGitter> <Daniel-Worrall> Have you tried to resolve host names on not-crystal
<FromGitter> <fridgerator> yes it work without crystal
<FromGitter> <fridgerator> I have a docker service linked as `postgres`, and I can use that host name with other services. Even older Crystal versoins work.
<FromGitter> <fridgerator> for instance I can `psql -h postgres`, works just fine
<FromGitter> <stronny> what's the output of `$ dig postgres`
<FromGitter> <fridgerator> there are discussions around this already, however its not really fixed
<FromGitter> <Daniel-Worrall> Are they on the same network? I haven't had any issues with host resolution
<FromGitter> <fridgerator> @stronny I dont have `dig` in my docker container, i'll try installing it there
<FromGitter> <stronny> apt package is `dnsutils`
<FromGitter> <fridgerator> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d84f792e45b6d473227e6c3]
<FromGitter> <stronny> `$ strace your-program`?
ht_ has joined #crystal-lang
<FromGitter> <fridgerator> ```strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted ⏎ +++ exited with 1 +++``` [https://gitter.im/crystal-lang/crystal?at=5d84fb49a7a5cc473326b921]
<FromGitter> <fridgerator> running as root
<FromGitter> <stronny> I don't like docker
<FromGitter> <stronny> what's listening on 127.0.0.11:53 udp? systemd-nameserverd?
<FromGitter> <naqvis> from the error its evident that its `LibC` which is failing on DNS resolution.
<FromGitter> <naqvis> might be code get run prior to orchestrator updating the `/etc/resolv.conf`
<FromGitter> <Daniel-Worrall> 1) 0.0.11 is the docker resolver
<FromGitter> <stronny> yeah, may be a race condition during cont startup
<FromGitter> <stronny> how about modifying /etc/hosts inside the cont?
<FromGitter> <naqvis> quick test could be run a simple crystal script to resolve service name, after bashing into container. the way you are running `psql`. if that still fails, that can rule-out race condition, and might be something off binding and/or invocation of LibC
<FromGitter> <Daniel-Worrall> if it's a race condition, just put a depends_on in the compose
ua has quit [Ping timeout: 246 seconds]
ua has joined #crystal-lang
<FromGitter> <Daniel-Worrall> I'm looking to use https://github.com/vladfaust/timer.cr ⏎ Can anyone think of a way to do this without the method def? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d851018901bb84d90428ff9]
<FromGitter> <Blacksmoke16> is the goal here to just execute some code after x period of time?
<FromGitter> <Daniel-Worrall> Yeah
<FromGitter> <Daniel-Worrall> On a loop
<FromGitter> <Daniel-Worrall> I could probably do it with std instead
<FromGitter> <Blacksmoke16> whats the use case? as wouldnt that example just always sleep?
<FromGitter> <c-cube> ```spawn { loop { sleep 3.seconds }}``` ⏎ ⏎ maybe [https://gitter.im/crystal-lang/crystal?at=5d8510c0b9f8210ed5be8d9d]
<FromGitter> <Daniel-Worrall> I should probably just spawn
<FromGitter> <Daniel-Worrall> Blacksmoke, the use case it just code on a timer I guess
<FromGitter> <Daniel-Worrall> but my brain didn't realise it was that simple at the time
<FromGitter> <Blacksmoke16> πŸ‘
<FromGitter> <c-cube> oh wow, the `select` example :o
<FromGitter> <c-cube> I guess the timer implements the ChannelAction magic or whatever
<FromGitter> <Daniel-Worrall> Yeah
<FromGitter> <Daniel-Worrall> I liked that example
<FromGitter> <c-cube> so that means channels are truly extensible… :o
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
hypercore has joined #crystal-lang
<hypercore> what are the advantages of crystal over elixir?
<FromGitter> <c-cube> speed and typing, I suppose?
<hypercore> i really like lucky framework so far, i'm just worried that the community isn't that large
<hypercore> i.e. that i learn the language/framework and then in a year they become abandoned
<FromGitter> <Blacksmoke16> i would doubt it
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<FromGitter> <Daniel-Worrall> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d851a29ab4244767bd5d42e]
daemonwrangler has quit [Ping timeout: 245 seconds]
<FromGitter> <Daniel-Worrall> That's what I ended up doing
<FromGitter> <Daniel-Worrall> Initial timeout it hasn't expired yet, then just a subscribe/timeout on a loop
<FromGitter> <Blacksmoke16> whoa what, sleep for 10 days?
mjblack has quit [Ping timeout: 240 seconds]
daemonwrangler has joined #crystal-lang
<FromGitter> <Daniel-Worrall> Twitch Webhooks
<FromGitter> <Daniel-Worrall> They have a 10 day max expiry
<FromGitter> <Daniel-Worrall> Actually, I may just need to use that Timer lib later because I'll need to work in unsubscribing
<FromGitter> <Daniel-Worrall> so I'll need to cancel some timers mid-run
<FromGitter> <Daniel-Worrall> so it doesn't just constantly subscribe even when I don't want it to
mjblack has joined #crystal-lang
<FromGitter> <Blacksmoke16> was going to say wouldnt it be easier to like have the webhook hit some API endpoint
<FromGitter> <Blacksmoke16> and depending on what you need to do with it, maybe enqueue it for some async worker to handle
<FromGitter> <Daniel-Worrall> yeah, they don't notify on expiration
<FromGitter> <Daniel-Worrall> They're sending the webhook to my route, and I'm acting on those, but I need to subscribe to the topics I want, then renew them every 10 days
<FromGitter> <Daniel-Worrall> I'll probably just implement my own Timer class in the future instead
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <Daniel-Worrall> Saves on dependencies
<FromGitter> <c-cube> ugh, now I really want a semaphore
<FromGitter> <c-cube> to limit the concurrency
<FromGitter> <didactic-drunk> would a countdownlatch suffice?
<FromGitter> <c-cube> sure, but there's none in the stdlib, right?
<FromGitter> <didactic-drunk> Correct.
<FromGitter> <nsuchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d85284b56677e767a2bd838]
<FromGitter> <nsuchy> I've gotten down to
<FromGitter> <nsuchy> the maps from earlier gave a bunch of compiler errors, and didn't include getting the ID from VMs
<FromGitter> <Blacksmoke16> ☝️ September 20, 2019 11:14 AM (https://gitter.im/crystal-lang/crystal?at=5d84ecd7be709e39d160ea4e)
<FromGitter> <nsuchy> I read that
<FromGitter> <nsuchy> there are three seperate tables that need to be referenced
<FromGitter> <Blacksmoke16> so do three queries, one for each table
<FromGitter> <Blacksmoke16> still would be more efficient than doing a single select for each id
<FromGitter> <c-cube> @didactic-drunk there you go ;) https://github.com/didactic-drunk/concurrent.cr/pull/1
<FromGitter> <c-cube> this was very pleasant to write, even the test…
hightower2 has joined #crystal-lang
tdc_ has joined #crystal-lang
tdc has quit [Ping timeout: 240 seconds]
tdc_ has quit [Quit: Leaving]
hightower2 has quit [Ping timeout: 240 seconds]
ht_ has quit [Remote host closed the connection]
<FromGitter> <jwoertink> When I try to build crystal manually and run `make`, I get `dyld: Library not loaded: /usr/local/opt/libevent/lib/libevent-2.1.6.dylib`
<FromGitter> <jwoertink> I'm not sure what in crystal needs this, but is there a way to specify a later version?
<FromGitter> <tflem> Are there any Crystal podcasts yet?
<FromGitter> <jwoertink> I don't know about podcasts, but there's crystalweekly.com
<FromGitter> <jwoertink> which may mention some
<FromGitter> <tflem> Nice, will check that out.
<FromGitter> <jwoertink> `make clean crystal && make` seemed to fix my issue. Weird though.
<FromGitter> <Daniel-Worrall> `!(a == b) || !(c == d)` you guys think this looks fine?#
<FromGitter> <Daniel-Worrall> or is there a better way to test equality of 2 similar things
<FromGitter> <Daniel-Worrall> objects, but not the same type
<FromGitter> <Daniel-Worrall> The equiv is `!((a == b) && (c == d))` from w/e it's called
<FromGitter> <Daniel-Worrall> oh yeah... `!=`
hypercore has quit [Ping timeout: 260 seconds]
alex`` has quit [Ping timeout: 276 seconds]
sagax has quit [Ping timeout: 268 seconds]
hypercore has joined #crystal-lang
the-asterite has joined #crystal-lang
<FromGitter> <watzon> Yeah that's a thing lol
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d85574ea38dae3a638bf50a]
<FromGitter> <Blacksmoke16> isnt this a thing that should work?
<FromGitter> <asterite> it's been gone for a while
<FromGitter> <watzon> `flush_on_newline` got removed in 0.28.0 iirc
<FromGitter> <Blacksmoke16> ah, replaced with sync
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <Blacksmoke16> am looking into https://github.com/Blacksmoke16/oq/issues/29 im kinda confused tho
<FromGitter> <Blacksmoke16> works fine on my debian desktop, but is cut off on mac
<FromGitter> <Blacksmoke16> if i output directly to `STDOUT` its fine, so must be something with the pipe?
<FromGitter> <Blacksmoke16> `IO.pipe`*
<FromGitter> <asterite> make sure to also read https://github.com/crystal-lang/crystal/issues/7431
<FromGitter> <asterite> sync is true for tty, false for anything else (like redirecting to a file or pipe)
the-asterite has left #crystal-lang [#crystal-lang]
<FromGitter> <asterite> oh, wait, output cut off? it's a different bug
<FromGitter> <Blacksmoke16> hmm, not sure if its that either, there isnt an exception
<FromGitter> <Blacksmoke16> `curl https://docs.docker.com/engine/api/v1.30/swagger.yaml | oq -i yaml .`
<FromGitter> <Blacksmoke16> piping it to `less` or a file its fine
<FromGitter> <Blacksmoke16> prob some issue with my fiber setup, adding a sleep to the end fixes it as well
<FromGitter> <Blacksmoke16> seems like such a hack, fibers will be my downfall
<FromGitter> <Blacksmoke16> no idea why this would only be an issue on mac tho
<FromGitter> <Blacksmoke16> i think the issue is the program finishes before the rest of the data can be outputted
<FromGitter> <Daniel-Worrall> if sleep fixes it, it's not running/passing off the fibers enough
<FromGitter> <Daniel-Worrall> Sleep will let all fibers finish all their executions
<FromGitter> <Blacksmoke16> ideally i would need a way that would let each fiber finish, then exit
<FromGitter> <Blacksmoke16> prob could do something with a channel?
<FromGitter> <Blacksmoke16> holy shit i did it
<FromGitter> <Blacksmoke16> i mean is this the way to do it or?