<FromGitter>
<KCreate> is the content-disposition header automatically set?
<FromGitter>
<txdv> its just empty
<FromGitter>
<txdv> @crisward are you on a mac?
<FromGitter>
<crisward> @txdv yes
gloscombe has joined #crystal-lang
<FromGitter>
<crisward> Just tried basic example and I'm getting the same as you. In my full app it works, so I'm guessing something may need to be configured in kemal to work
<FromGitter>
<txdv> the target directory for temporary files?
<FromGitter>
<KCreate> that should be /tmp by default i guess
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
<FromGitter>
<txdv> @KCreate what is your guess on why it is not working?
<FromGitter>
<KCreate> Either the browser not transmitting the file correctly or Kemal not being configured correctly
<FromGitter>
<sdogruyol> I'm not sure why it breaks though, need to do some testing
<FromGitter>
<sdogruyol> thanks for the report
<FromGitter>
<crisward> Not wanting dead files in the upload good, I'm guessing the test for it needs to be more concrete, perhaps something in the FileUpload class?
<FromGitter>
<KCreate> I don't understand why upload.size would cause his files to be removed from the array
<FromGitter>
<crisward> @KCreate it doesn't get added to the array if the size is nil
<FromGitter>
<KCreate> Okay I see, wasn't familiar with HTTP::FormData::Part
<FromGitter>
<sdogruyol> not sure why but size if always nil for upload any ideas @RX14 ?
<FromGitter>
<crisward> Is it because it's a stream? Does it get bigger after you start piping it?
<FromGitter>
<sdogruyol> hmm
alibby has quit [Read error: No route to host]
alibby1 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
bjz has joined #crystal-lang
<FromGitter>
<KCreate> Aren't these values taken from the headers?
blassin has joined #crystal-lang
<blassin>
hey all!
bjz_ has joined #crystal-lang
<FromGitter>
<KCreate> hey
bjz has quit [Ping timeout: 240 seconds]
<blassin>
this whole Slice/Array thing is still very confusing to me :|
<blassin>
how can I split a Slice into smaller Slice? all I get is Array(UInt8)
<FromGitter>
<KCreate> A slice is basically just a pointer with out-of-bounds checks
<Papierkorb>
blassin: Are you sure you actually need a Slice? What are you trying to do?
<blassin>
read a binary file's content and write it to a socket
<blassin>
but I want to stagger the socket write, in order to have some delay between the lines of the file
<Papierkorb>
Slice#[] takes a range or a (start, length) tuple, which returns the sub-slice of that part
<blassin>
ah I see thanks
<blassin>
and why does #each_slice on a Slice(UInt8) return an Array(UInt8) ?
<Papierkorb>
because that comes from Enumerable(T), which works with arrays.
<blassin>
is there an easy way to convert that Array back to a Slice? #each_slice seems to be the best way to do it in lines
<Papierkorb>
Sadly, that'll waste tons of memory too.
<blassin>
yeah... sounds like it would
<blassin>
oh well
<FromGitter>
<KCreate> Does anyone know if there's a SOAP library for crystal? Can't find anything in google
<FromGitter>
<guillaume-g> I have a CONSTANT called CACHE_TYPES where I assign an Hash object. When I try to use this constant by doing "CACHE_TYPES["toto"]", I got the following error : CACHE_TYPES is not a type, it's a constant
<FromGitter>
<guillaume-g> You can't just have the value of CACHE_TYPES[config.type] directly stored in an class variable
<FromGitter>
<guillaume-g> You have to use an another non-class variable to store the value of CACHE_TYPES[config.type] inside then put it into the class variable
<FromGitter>
<fridgerator> doing that works for you?
<FromGitter>
<guillaume-g> yes
<FromGitter>
<fridgerator> ok cool
<FromGitter>
<guillaume-g> Thanks for your time
<FromGitter>
<fridgerator> sure np
<FromGitter>
<bcardiff> There was somo ivar / class var initialization issues fixed in 0.21.1
<FromGitter>
<bcardiff> @guillaume-g if you can, check with the latest version. If things are not solved / clear please submit an issue :-)
<FromGitter>
<fridgerator> @KCreate I wasn't aware AMI's are region specific, what region were you trying to use? I can copy it there
<FromGitter>
<schoening> That's actually good to re-read. So empty strings are truthy in crystal then?
<FromGitter>
<KCreate> @fridgerator eu-west-1
<FromGitter>
<KCreate> @schoening exactly. `0` is also truthy
<FromGitter>
<schoening> Oh wow ok. I thought: "null pointers (pointers whose memory address is zero)" meant 0 would be falsey
mgarciaisaia has quit [Quit: Leaving.]
<FromGitter>
<fridgerator> @KCreate ok copied, the ami id is : `ami-199dab7f`, it might take a few mintues to show up
<FromGitter>
<KCreate> No, `0` is of type `Int32`. With pointers they mean this: `Pointer.new 0`
<FromGitter>
<KCreate> that would be a null pointer
<FromGitter>
<KCreate> @fridgerator thanks!
<FromGitter>
<crisward> @schoening that's why I asked, the `=` is confusing
<FromGitter>
<crisward> I've seen it in a lot of libraries written in crystal and I've always thought assignment in if statements is confusing. It's generally avoid in JS, except for those JS ninjas, the sort who think it's cool to change base prototypes.
<FromGitter>
<fridgerator> @KCreate still have to manually install openssl and gcc, I'm thinking about including those as a part of the AMI, since they will almost always be required: `sudo yum install openssl-devel gcc`
gloscombe has joined #crystal-lang
<RX14>
@sdogruyol as with content-length, size is a set value
<RX14>
unlike content-length it's not mandatory
<RX14>
and eith both you have to trust the cline tto be correct regardless
<RX14>
with* client*
<RX14>
I can't spot an error in the parsing code so it's likely just not been set
<RX14>
what generated the multipart which you're parsing?
<FromGitter>
<crisward> @RX14 it was a html form
<RX14>
could you verify if the size is actually sent?
<FromGitter>
<crisward> The content length header is set
mark_66 has quit [Remote host closed the connection]
<RX14>
but is the size header in the multipart headers set?
<FromGitter>
<crisward> At the moment kemal is creating a temp file when the file is left empty. As none of the value are mandatory, is would seem to make sense to leave it to create an empty file. It gets cleaned up after the request. Not sure what the alternatives are?
pawnbox has joined #crystal-lang
<FromGitter>
<sdogruyol> ugh that's nasty then
<FromGitter>
<sdogruyol> :(
blassin has quit [Quit: Page closed]
<RX14>
you can't even rely on content-length
<RX14>
it won't be there if the content is chunked
<FromGitter>
<sdogruyol> so there's actually no way to control
<FromGitter>
<sdogruyol> lol
<RX14>
no
<RX14>
thats why we have streams
<FromGitter>
<sdogruyol> i mean to check beforehand
<RX14>
they're user supplied numbers
<RX14>
you can't trust them anyway
<FromGitter>
<sdogruyol> :/
<RX14>
never trust anything
tzekid has joined #crystal-lang
tzekid has quit [Client Quit]
tzekid has joined #crystal-lang
Guest64566 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leonardschuetz has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest36584
Guest36584 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gloscombe has quit [Remote host closed the connection]
<FromGitter>
<drosehn> Maybe everyone here already knows, but I'll mention it anyway: If you want to use `person.name` inside the `if` clause, crystal cannot assume it will get the same value from a second call to `person.name` as it got the first time. So if you used `person.name.is_a?(String)` as the `if` condition, the crystal compiler would still have no idea what the second call to `person.name` might return.
<FromGitter>
<drosehn> So you need to make a local copy of the value from `person.name`, and then use that.
<crystal-gh>
[crystal] bcardiff pushed 1 new commit to master: https://git.io/vy7BA
<crystal-gh>
crystal/master 9e67166 Sijawusz Pur Rahnama: GIT_REMOTE_PATTERNS regexes are being overly greedy (#4132)...
leonardschuetz has joined #crystal-lang
leonardschuetz has left #crystal-lang [#crystal-lang]
leonardschuetz has joined #crystal-lang
<FromGitter>
<drosehn> I generally cringe at using `blah = value` in an `if` condition because you really *do* want to assign values, because I've seen so many bugs in C where someone wrote `blah = value` when they really meant `blah == value`. But that comes up often in crystal.
<FromGitter>
<crisward> @drosehn If you're only calling one thing, you could do it all on one line, but I'm not sure I like long expressions any more...
<FromGitter>
<crisward> @ezrast try is definitely less confusing
synstack has left #crystal-lang ["Quit message"]
<FromGitter>
<drosehn> So make it a compound statement, over multiple lines... :smile: ⏎ ⏎ ```(name = person.name) && ⏎ name.is_a?(String) && ⏎ greet(name)``` ⏎ ⏎ (no, I wouldn't really want to do this...) [https://gitter.im/crystal-lang/crystal?at=58cc43531c040b8e040a8303]
<FromGitter>
<elorest> Is there a somewhat simple way to interact with/wrap a cli interface like irb or mysql so that you can send messages to the process and see the response?
jokke has quit [Read error: Connection reset by peer]
<FromGitter>
<elorest> Someway to interact with a processes standard in and out? Process.run seems possible but I can't seem to find much documentation on it.
<FromGitter>
<fridgerator> I can't speak to `Process` much specifically, but sometimes looking at the specs is better than the documentation
<FromGitter>
<elorest> Good idea. Thanks.
<FromGitter>
<elorest> I'm trying to interact with bluez from kemal. I was hoping to just bind to libbluetooth.so and compile everything together but all of it's params are pointers and structs that are defined, god knows where. So i'm thinking maybe I should just wrap the bluetoothctl process. Any ideas or pointers would be welcome.
<RX14>
i'd definitely go with binding libbluetooth
<RX14>
everything you need should be in /usr/include/bluetooth
bjz has joined #crystal-lang
<RX14>
wow libbluetooth looks like a mess
<Papierkorb>
just scrolled through its headers, what's so bad about it?
<RX14>
lots of inline defs in the headers
<Papierkorb>
most of them don't look too useful, or are easily implementable
<RX14>
sure but there's little to no documentation