<FromGitter>
<manveru> or you can just statically compile it anyway, if you want to distribute it without nix
<FromGitter>
<manveru> i really love that about crystal
<FromGitter>
<j8r> except it is a bit broken :(
<FromGitter>
<j8r> (no stack traces)
<FromGitter>
<manveru> true that...
<FromGitter>
<manveru> just never write a program that can crash :D
<FromGitter>
<tenebrousedge> this is an excellent idea
<FromGitter>
<manveru> (I really wish crystal had no exceptions and only option types...)
<FromGitter>
<tenebrousedge> \>_<
<FromGitter>
<tenebrousedge> this is a less excellent idea
<FromGitter>
<manveru> lol
<FromGitter>
<Blacksmoke16> anyone else think its kinda strange to have the response of an http request always exist?
<FromGitter>
<Blacksmoke16> versus like, newing up an `Event` yourself
<FromGitter>
<Blacksmoke16> er
<FromGitter>
<Blacksmoke16> `Response`
<FromGitter>
<manveru> i also find it strange that requests with multipart files always make tempfiles...
<FromGitter>
<manveru> but well, i guess it's written to be super convenient for the most usual use-cases
<FromGitter>
<Blacksmoke16> guess the solution for me would be to just close the response when its done
<FromGitter>
<Blacksmoke16> and key off that if i should return early
<FromGitter>
<Blacksmoke16> but the downside is there it would return the response immediately, maybe i should add a new property to it, like `finished : Bool = false`?
<FromGitter>
<manveru> omg, i just noticed firefox finally has websocket inspector again
<FromGitter>
<Blacksmoke16> dont really have any of that
<FromGitter>
<tenebrousedge> why is `uri` nil?
<FromGitter>
<Blacksmoke16> looks like its lazily evaluated and not exposed anyway
<FromGitter>
<tenebrousedge> that seems like a malformed request then?
<FromGitter>
<Blacksmoke16> shouldnt be
<FromGitter>
<tenebrousedge> well, that or the remote address should have `http` or `https` in there. It doesn't look like it stores the protocol separately
<FromGitter>
<Blacksmoke16> would be nice to have the scheme in there
<FromGitter>
<tenebrousedge> probably. Why do you need it?
<FromGitter>
<Blacksmoke16> refactoring my cors listener
<FromGitter>
<Blacksmoke16> if the origin header is present and it matches the scheme/host of the request cors isnt needed
<FromGitter>
<tenebrousedge> can't you just assume http if not present?
<FromGitter>
<Blacksmoke16> possibly
<FromGitter>
<Blacksmoke16> still wouldnt know if its https or not tho
<FromGitter>
<tenebrousedge> well, if it's not in the request, then I don't see how it could be https
<FromGitter>
<Blacksmoke16> probably more of a server thing
<FromGitter>
<tenebrousedge> but shouldn't it fail either way if it doesn't match?
<FromGitter>
<Blacksmoke16> if they dont match then it should do the CORs stuff
<FromGitter>
<Blacksmoke16> just is a little optimization
<FromGitter>
<tenebrousedge> the server definitely knows what port it's listening on
<FromGitter>
<Blacksmoke16> yea ill prob have to get it off there
<FromGitter>
<Blacksmoke16> ill worry about it later
<FromGitter>
<nsuchy> @Blacksmoke16 You could run your app behind nginx and pass an X-Schema header and include http or https from the proxy
<FromGitter>
<Blacksmoke16> `undefined method 'url' for HTTP::Request`
<FromGitter>
<Blacksmoke16> `uri` is private method if that was a typo
<FromGitter>
<Blacksmoke16> @dscottboggs
<FromGitter>
<Blacksmoke16> @nsuchy not a bad idea
<FromGitter>
<Blacksmoke16> either way the uri wouldnt have the scheme since its being parsed from the resource, which in this cast is just the path
Flipez2 is now known as Flipez
DTZUZO has quit [Read error: Connection reset by peer]
DTZUZO has joined #crystal-lang
return0__ has joined #crystal-lang
return0e has quit [Ping timeout: 245 seconds]
<FromGitter>
<Blacksmoke16> looks like symfony either grabs it from the Proto header if the request was from a valid configured proxy, otherwise defaults to some server level config value
<FromGitter>
<Blacksmoke16> will make that a future optimization as id need to support some configuration around trusted proxies and stuff
<FromGitter>
<Daniel-Worrall> Hmm is there a way I can take a certain amount of steps in an iterator block? `next` will only go once, and I'd like to skip over some things without having to test them
<FromGitter>
<Daniel-Worrall> I can come up with a way how to do this with an iterator without the block
<FromGitter>
<Daniel-Worrall> but this reads a lot better
<FromGitter>
<Blacksmoke16> `next if num >= 10 && num <= 19`
<FromGitter>
<Daniel-Worrall> but that involves testing those cases
<FromGitter>
<Blacksmoke16> maybe just remove those numbers before iterating then
<FromGitter>
<Daniel-Worrall> I won't know what to remove without iterating with the guard clause
<FromGitter>
<Daniel-Worrall> I just want to be able to skip over x amount of times in an iterator, since I'll know in advance they'll fail the check
<FromGitter>
<Daniel-Worrall> but only once reaching the one before it
<FromGitter>
<Daniel-Worrall> I don't think there's a way
<FromGitter>
<alehander92> is the problem in performance
<FromGitter>
<alehander92> or just in code elegance
<FromGitter>
<Daniel-Worrall> both?
<FromGitter>
<Daniel-Worrall> in my limited case, performance doesn't matter, but it'd be a nice thing to have in my toolkit for when performance does matter
<FromGitter>
<Daniel-Worrall> the important part is that it's still testing those elements
<FromGitter>
<kinxer> Calling `Iterator#reject` wraps the iterator in this struct.
<FromGitter>
<kinxer> So it does check as it iterates.
<FromGitter>
<Daniel-Worrall> ah, okay
<FromGitter>
<Daniel-Worrall> but it would still check
<FromGitter>
<kinxer> Yeah, it's going to do the check on every element, but that's true in https://carc.in/#/r/87q4, too.
<FromGitter>
<Daniel-Worrall> I don't think so, it'll call next 10 times without making the conditional check
<FromGitter>
<Daniel-Worrall> What I'm thinking is if the conditional is an expensive calculation, I want to skip over as many as I can
<FromGitter>
<kinxer> Ah, that's true.
<FromGitter>
<kinxer> So there could be a performance penalty if you're skipping a ton of elements and/or the check is really expensive.
<FromGitter>
<Daniel-Worrall> `next` gets the next element, which I'd prefer to avoid too.
<FromGitter>
<Daniel-Worrall> I could probably write a function on iterator that does what I want actually
<FromGitter>
<kinxer> I mean, it seems like a reasonable use case for`Enumerable` to skip the `n`th element to the `m`th element.
<FromGitter>
<kinxer> In an ideal world, it would never be necessary because all inputs would be well-formed and useful, but that's not the world we live in.
<FromGitter>
<alehander92> but you can always do something like each_with_index and do a cheap check
<FromGitter>
<alehander92> probably possible to make more elegant with some abstraction
DTZUZO has quit [Ping timeout: 268 seconds]
DTZUZO has joined #crystal-lang
ht_ has joined #crystal-lang
cpt_yossarian has quit [Ping timeout: 248 seconds]
woodruffw has joined #crystal-lang
<FromGitter>
<johnpyp> Is there a way to manage decimal unicode encoding/decoding?
<FromGitter>
<johnpyp> i.e `ord()` and `chr()` in python
<FromGitter>
<Blacksmoke16> pretty sure they're already a thing
Yxhuvud has quit [Read error: Connection reset by peer]
<FromGitter>
<watzon> From numpy?
<FromGitter>
<watzon> Damn you had to do a whole parser for that huh?
<FromGitter>
<christopherzimmerman> I couldn't really use numpy as inspiration since they have a bunch of macro stuff done in C that adds a ton of overhead I don't need.
<FromGitter>
<christopherzimmerman> Plus they don't really optimize any of the contraction paths, so I think I can do a lot better with that as well.
<FromGitter>
<randiaz95> guys, god bless Crystal
<FromGitter>
<randiaz95> <3
<FromGitter>
<randiaz95> i can't believe you guys are working on einsum in crystal
<FromGitter>
<randiaz95> Are you guys good at tensor algebra?
ht_ has quit [Remote host closed the connection]
ht_ has joined #crystal-lang
ur5us has joined #crystal-lang
watzon has quit [Quit: WeeChat 2.7]
Yxhuvud has joined #crystal-lang
<FromGitter>
<watzon> I'm sure now
<FromGitter>
<watzon> But @christopherzimmerman seems to be ok at it
ht_ has quit [Remote host closed the connection]
DTZUZO has quit [Ping timeout: 246 seconds]
DTZUZO has joined #crystal-lang
ur5us_ has joined #crystal-lang
ur5us has quit [Read error: Connection reset by peer]