<oprypin>
they could very easily enforce immutable tags for published actions, but no
sagax has quit [Ping timeout: 256 seconds]
<FromGitter>
<oprypin:matrix.org> @mattrberry: so do you like my pull request with gh-actions? you can just push something to a branch and see if it works well there. right now it exposes the error on mac that previously @ watzon had to tell you about (and you said is already fixed)
<raz>
yeh actions are pretty half-baked still.
<FromGitter>
<asterite> Dan Simpson: if the subclass doesn't implement the method the compiler will tell you when you try to call that method. You can say in the docs which methods needs to be defined and how
<FromGitter>
<mattrberry> @oprypin Yeah thanks for submitting that! Only had a chance to skim it so far, but looks helpful! I haven’t pushed the changes to fix the Mac issue yet since I was going to push all of the Mac fixes together when I can figure out why the shaders still aren’t compiling. Thanks for the PR!
postmodern_ has joined #crystal-lang
postmodern has quit [Remote host closed the connection]
<FromGitter>
<jrei:matrix.org> oprypin (https://matrix.to/#/@oprypin:matrix.org): in a way GHA is like shards: we can install & use third party modules, and change the tags freely
<FromGitter>
<jrei:matrix.org> Another solution is to have GitHub warn us of the commit change
deavmi has quit [Read error: Connection reset by peer]
<FromGitter>
<mattrberry> Do you have any idea how to debug this? I know very little about OpenGL in general, let alone dealing with the finicky mac behavior..
<FromGitter>
<mattrberry> Ooh, got it to build on my rented mac..
<FromGitter>
<mattrberry> Now to see if it builds on my friend's machine..
<FromGitter>
<erdnaxeli:cervoi.se> what do you think is wrong?
<FromGitter>
<erdnaxeli:cervoi.se> oh, the .0
<FromGitter>
<erdnaxeli:cervoi.se> it works with a Float64
<FromGitter>
<Daniel-Worrall> It doesnt have enough bits for the amount of accuracy
<FromGitter>
<Dan-Do> Wow, just know that :)
<FromGitter>
<asterite> Looks fine to me
<yxhuvud>
And that is why you shouldn't use floats to represent currency.
<FromGitter>
<Dan-Do> Then we should use double, right?
<FromGitter>
<watzon> No, use standard integers for currency always
<straight-shoota>
or bigdecimal
<FromGitter>
<watzon> That would work as well
<FromGitter>
<watzon> As a general rule of thumb though, it's easy to represent a monetary value like `$10.00` as `1000`
<straight-shoota>
yeah. Unless you need to represent values smaller than the smallest nominal currency value
<FromGitter>
<Dan-Do> Uhm, that needs more effort. Fair enough :)
<FromGitter>
<watzon> Right. In which case you can always adjust things. You could potentially represent $10.00 as 100000 which would give you two extra places for fractions of a cent. The important thing is that you choose a method and stick to it.
<straight-shoota>
It's probably not relevant here, but I don't think it's good advice. Either you have simple requirements and can just use integers with the number 1 representing the smallest nominal value (like 1 cent)
<straight-shoota>
or you should really use bigdecimal because that gives you unlimited precision. Who knows if 100000 is good enough when at some point you need to represent smaller fractions?
<straight-shoota>
But again, that's not a typical use case.
<FromGitter>
<Dan-Do> The thing is there is not only crystal, I also have the UI part which uses javascript, and the database part...
<FromGitter>
<erdnaxeli:cervoi.se> all need to correctly handles the precision you want
<raz>
pass monetary values as strings to the clients. never perform math on them in there.
<raz>
anything else will inevitably bite you, esp. when you deal with multiple currencies
<FromGitter>
<Dan-Do> sounds complicated, huh :)
<straight-shoota>
For represenation you may get away with 64-bits floating point if the values are in a small range.
<straight-shoota>
But currency calculation with floating point arithmetics is a no-go
<straight-shoota>
But, using string for representation is probably better. It especially prevents using the value in math operations.
<straight-shoota>
Well, I guess not in JavaScript...
oddp has joined #crystal-lang
lanodan has quit [Quit: WeeChat 2.9]
<FromGitter>
<watzon> Yeah if you're dealing with JavaScript definitely use integers, provided you don't need fractions of a cent
<FromGitter>
<watzon> Floats will always, always bite you in the ass
<straight-shoota>
but that's not restricted to JS ^
<FromGitter>
<watzon> No, but JavaScript doesn't have arbitrary precision integers like Crystal so Integers would be their best bet
richbridger has joined #crystal-lang
<FromGitter>
<watzon> I should say arbitrary precision decimals, like BigDecimal
<FromGitter>
<watzon> Though there's probably a library somewhere out there
<FromGitter>
<watzon> Well "numbers". The idea is to keep decimals out of it.
<raz>
yea well, that's the problem. the moment you do anything with the values, js screws them up. how critical that is ofc depends on the use-case, but most people don't like rounding errors and precision lapses when money is involved ;)
<FromGitter>
<watzon> Yeah for sure. Losing a cent here and overcharging a cent there can really add up in the end.
<raz>
blacksmoke: the custom annotation looks useful, for the rest i'll probably just stick to reading directly from env :)
<raz>
(but looks like the rest can also be useful when someone wants to build an athena-plugin/extension)
postmodern has joined #crystal-lang
<FromGitter>
<Blacksmoke16> raz: if you only have like 1 or 2 things its prob not that big of a deal to use them. But IMO parameters do provide quite a few benefits
<FromGitter>
<Blacksmoke16> type saftey, reusability, centralized location, and custom methods/logic to name a few
<FromGitter>
<Blacksmoke16> er sorry, `IO.copy file, context.response`
<FromGitter>
<gunn> Okay, I'll do that
<FromGitter>
<gunn> I don't think that's my main bottleneck though, I think that will be a fraction of a second vs. 10-20s for those system calls
<FromGitter>
<gunn> I'm very new to crystal btw
<FromGitter>
<gunn> Is there a way to write the system calls so that crystal knows it's a good time to switch fibers?
<FromGitter>
<Blacksmoke16> i guess do they need to be system calls?
<FromGitter>
<Blacksmoke16> could prob do the curl request via an `HTTP::Client`
r0bby has quit [Ping timeout: 264 seconds]
<FromGitter>
<gunn> Yes, I could definitely replace that
r0bby has joined #crystal-lang
HumanG33k has quit [Quit: Leaving]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
<FromGitter>
<Blacksmoke16> id try to rule out that its actually the `system` call thats doing it. I.e. add sleeps
<FromGitter>
<gunn> Yes
<FromGitter>
<Blacksmoke16> iirc this came up before and it was something related to what chrome was doing (assuming you were calling the endpoint from 2 tabs)
<FromGitter>
<gunn> Okay, I'll test with curl then
<FromGitter>
<Blacksmoke16> if one fiber blocks then it should continue to process other requests
<FromGitter>
<Blacksmoke16> i know that for sure
sagax has quit [Remote host closed the connection]
DTZUZU has quit [Read error: Connection reset by peer]