pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
greengriminal has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
Raimondii has joined #crystal-lang
greengriminal has quit [Ping timeout: 264 seconds]
greengriminal has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
Philpax has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 244 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
Dreamer3 has joined #crystal-lang
Dreamer3 has quit [Client Quit]
pawnbox has joined #crystal-lang
Oliphaunte has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
Oliphaunte has quit [Ping timeout: 240 seconds]
zodiak has joined #crystal-lang
sp4rrow has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
fridgerator has joined #crystal-lang
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
zodiak has quit [Ping timeout: 260 seconds]
zodiak has joined #crystal-lang
sp4rrow_ has joined #crystal-lang
djdarkbeat has joined #crystal-lang
<djdarkbeat>
Hello
sp4rrow has quit [Ping timeout: 240 seconds]
<fridgerator>
hi
Oliphaunte has joined #crystal-lang
<djdarkbeat>
I’m looking for some guidance working with Slice and unpacking bitstrings.
<djdarkbeat>
I have a protocol that has mixed Endian-ness, bitpacked, UInt16, UInt32 and other stuff.
<djdarkbeat>
So far I have been able to read the file, create a slice fo UInt8, dump to hex etc.
<djdarkbeat>
But I am a little lost with trying to get the whole packet as a slice with mixed types in it.
Oliphaunte has quit [Ping timeout: 258 seconds]
<djdarkbeat>
Would I want to byte_slice(0,2) to get my first UInt16 from the packet?
<djdarkbeat>
can I create a grammar to define the packing order of the UInt16, UInt32 and bitpacked elements of my data?
fridgerator has quit [Ping timeout: 250 seconds]
<djdarkbeat>
I’ll go read the message_pack library or something to get some ideas.
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
ome has joined #crystal-lang
djdarkbeat has quit [Ping timeout: 258 seconds]
djdarkbeat has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 264 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
sp4rrow_ has quit [Quit: Textual]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
matp has quit [Excess Flood]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
<jhass>
djdarkbeat: well, you likely don't want to read the whole packet into a slice and then extract stuff, but rather read each field from the IO directly and perhaps assemble a struct that holds the data while doing that
<jhass>
IO has some facility to read various types in either endianess directly from it
ponga has joined #crystal-lang
pawnbox has joined #crystal-lang
<jhass>
specifically you can do things like UInt16.from_io(socket, IO::ByteFormat::BigEndian)
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
onethirtyfive has joined #crystal-lang
<onethirtyfive>
hi everyone. noobie question! If I wanna bind to an `unsigned` field in a struct in a C lib, what type do I declare in my crystal `struct`? As I understand it, unsigned is platform-dependent.
<onethirtyfive>
I feel like if I figure out what `unsigned` is on my computer, and then use the corresponding UInt* type in my declaration, it might break on someone else's arch?
<jhass>
onethirtyfive: huh, just unsigned, not unsigned int or unsigned short or anything?
<FromGitter>
<jwoertink> that's what I'm working on now
<FromGitter>
<sdogruyol> realized that
<FromGitter>
<sdogruyol> hope it turns out to be something really useful
<FromGitter>
<jwoertink> I'd love some help if anyone wants to contribute!
<FromGitter>
<jwoertink> my company is starting to port over all our mini rails projects to crystal, so it's gonna be a very consistent thing for us
<FromGitter>
<sdogruyol> well, we have something like-ish to this but it's internal
<FromGitter>
<sdogruyol> and was written in bash :worried:
<FromGitter>
<sdogruyol> so i'm really rooting for Fez, cool idea @jwoertink
<FromGitter>
<jwoertink> thanks! :D
<FromGitter>
<sdogruyol> i can help you along the way
<FromGitter>
<jwoertink> sweet. That'd be awesome
<FromGitter>
<sdogruyol> sure!
<crystal-gh>
[crystal] endSly opened pull request #3039: BigInts should use gmp implementation of gcd and lcm (master...master) https://git.io/vKSPk
onethirtyfive has joined #crystal-lang
devinacosta has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Ping timeout: 240 seconds]
Oliphaunte has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
dannluciano has joined #crystal-lang
<devinacosta>
Just curious what your methods would be, if you have a program that needs to SSH into a box and run a command and then capture the output, return code, what is the best method that you would use to do that?
<jhass>
if you can get datanoise/ssh2 working (again), that
<jhass>
else Process.run
<devinacosta>
ok that's what i concluded to.
snsei_ has quit [Remote host closed the connection]
Raimondii has joined #crystal-lang
<RX14>
parsing content-disposition is just a massive pain
Raimondi has quit [Ping timeout: 240 seconds]
<RX14>
parsing the k=v thing itself is a pain because of where you can put whitespace
<RX14>
why can't they make their RFCs machine readable
<RX14>
its the whitespace, why can't they just specify no whitespace
Raimondii is now known as Raimondi
devinacosta has quit [Ping timeout: 250 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Oliphaunte has joined #crystal-lang
<crystal-gh>
[crystal] asterite pushed 2 new commits to master: https://git.io/vKSyM
<crystal-gh>
crystal/master 20ebc25 Ary Borenszweig: Fix in `pp` macro: don't paste single expression
<crystal-gh>
crystal/master afff13c Ary Borenszweig: Compiler: more simplifications and docs
onethirtyfive has quit [Remote host closed the connection]