ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | 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
learod has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
learod has quit [Remote host closed the connection]
learod has joined #crystal-lang
learod has quit [Remote host closed the connection]
That_Guy_Anon1 has joined #crystal-lang
That_Guy_Anon has quit [Ping timeout: 276 seconds]
return0e has quit [Ping timeout: 263 seconds]
return0e has joined #crystal-lang
learod has joined #crystal-lang
learod has quit [Remote host closed the connection]
learod has joined #crystal-lang
That_Guy_Anon2 has joined #crystal-lang
That_Guy_Anon1 has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
learod has quit [Remote host closed the connection]
learod has joined #crystal-lang
That_Guy_Anon1 has joined #crystal-lang
That_Guy_Anon2 has quit [Ping timeout: 240 seconds]
learod has quit [Remote host closed the connection]
learod has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
learod has quit [Remote host closed the connection]
unn4m3d has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
unn4m3d10 has joined #crystal-lang
unn4m3d has quit [Ping timeout: 276 seconds]
unn4m3d has joined #crystal-lang
unn4m3d10 has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Read error: Connection reset by peer]
unn4m3d10 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
unn4m3d has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Ping timeout: 264 seconds]
<FromGitter> <bararchy> @orbital-harmonix sounds interesting , what are you building ? Remote control via code? Is it Bluetooth controlled?
unn4m3d has joined #crystal-lang
rohitpaulk has joined #crystal-lang
unn4m3d10 has quit [Ping timeout: 264 seconds]
<FromGitter> <CaDs> I added documentation for Kernel#sprintf method (https://github.com/crystal-lang/crystal/pull/5762) ⏎ Please let me know if there is anything else I should do regarding this PR. ⏎ Thanks
<FromGitter> <bararchy> @CaDs nice work, you should @ both RX14 and @straight-shoota so they can review it
guilleiguaran__ has joined #crystal-lang
guilleiguaran__ is now known as guilleiguaran
That_Guy_Anon1 is now known as That_Guy_Anon
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
alex`` has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> lol omg https://github.com/p-e-w/ternimal
<FromGitter> <bew> wuuut that's incredible
<FromGitter> <bararchy> yes it is!
<FromGitter> <bararchy> Groogy take a look
<FromGitter> <bararchy> interesting how much lines of code to make it work in Crystal
<FromGitter> <bararchy> he said 1000 lines of Rust without dependencies
flaviodesousa has joined #crystal-lang
snsei has quit [Ping timeout: 265 seconds]
<Groogy_> haha that's cool
_whitelogger has joined #crystal-lang
<FromGitter> <straight-shoota> @CaDs Looks good to me, we're just missing another member review and approval.
<FromGitter> <straight-shoota> Unfortunately that's the reason why many PRs are stalled...
<FromGitter> <CaDs> @straight-shoota thanks for the reply. No problem I just wanted to know if there is anything else I should be changing for that PR. I guess eventually it will be merged :)
<FromGitter> <bararchy> @straight-shoota sounds like there should be more core-members, or, "PR approvel" staff, how about seeing if someone from the community is wiling to step up?
<wuehlmaus> i am interested, Arch Linux moved away from LLVM-5 but still it compiles crystal-git. So llvm6 and crystal seem not to be far away, right?
<FromGitter> <bararchy> wuehlmaus LLVM6 is supported AFAIK
<wuehlmaus> must be very new then
<wuehlmaus> bararchy: thanks.
<wuehlmaus> perhaps it doesn't work on Apple, i tried that some weeks ago and it wants llvm-5
<wuehlmaus> and January is quite away
<wuehlmaus> ah, work in progress....
return0e has quit [Ping timeout: 240 seconds]
return0e_ has joined #crystal-lang
<FromGitter> <r00ster91> shouldnt `:windows` be `:win32` on https://crystal-lang.org/api/0.24.2/File.html ?
<wuehlmaus> llvm-6 seems to work now when i compile crystal-git on Apple
<wuehlmaus> oh no, gives a linker error and does not compile here
return0e has joined #crystal-lang
<FromGitter> <bararchy> hmmm
return0e_ has quit [Ping timeout: 268 seconds]
<FromGitter> <bararchy> does it look for llvm5.so ?
<wuehlmaus> it wants to compile but then throws an error
<wuehlmaus> and with llvm5 it just works
<FromGitter> <bararchy> in Arch ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5aba0281e3d0b1ff2c70a921]
<FromGitter> <bararchy> no isse here :)
heaven31415 has joined #crystal-lang
return0e has quit [Ping timeout: 248 seconds]
<wuehlmaus> isse?
<FromGitter> <bararchy> ?
<wuehlmaus> <bararchy> no isse here :)
<FromGitter> <r00ster91> he means issue
<FromGitter> <bararchy> issue
<FromGitter> <bararchy> yeha sorry
<FromGitter> <bararchy> hahah
gewo has quit [Quit: WeeChat 1.6]
gewo has joined #crystal-lang
<wuehlmaus> yep, it does work here with llvm@5 and does not work with llvm which is 6 here. i had to do make clean. now it did compile. but as it works in Arch it is probably a minor issue that will be solved soon.
return0e has joined #crystal-lang
guilleiguaran has quit [Quit: Connection closed for inactivity]
<FromGitter> <Qwerp-Derp> Can anyone help me un-closure the proc in `add_menu`?
<FromGitter> <Qwerp-Derp> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5aba1187e3d0b1ff2c70f023]
unn4m3d has quit [Ping timeout: 256 seconds]
unn4m3d has joined #crystal-lang
unn4m3d10 has joined #crystal-lang
unn4m3d has quit [Read error: Connection reset by peer]
unn4m3d has joined #crystal-lang
unn4m3d10 has quit [Ping timeout: 264 seconds]
heaven31415 has quit [Ping timeout: 248 seconds]
straight-shoota has joined #crystal-lang
return0e has quit [Ping timeout: 240 seconds]
<FromGitter> <ArtLinkov> Groogy I was already asleep when you sent the message yesterday :) ⏎ Can you point me to the place in the code where the problematic translation happens?
<FromGitter> <bararchy> woot :) https://github.com/schovi/baked_file_system
<Groogy_> uploaded to seperate branch @ArtLinkov
<Groogy_> For the vector math
<Groogy_> the projected buttons doesn't seem to relate to the translation of the camera at all either :/
<Groogy_> though if I switch around the numbers in the Vector.project then I am back to that translation breaks the projection
<Groogy_> now I am at the closest to "working", I can move around but rotating is reversed it seems
<FromGitter> <bararchy> Groogy_ I'll give you @ArtLinkov back in 20 min ;) I'm making him do some Qlearning tunning
straight-shoota has quit [Ping timeout: 276 seconds]
straight-shoota has joined #crystal-lang
<FromGitter> <ArtLinkov> Groogy I'll take a look
<Groogy_> thanks, ask em anything that can help you about it
<Groogy_> but in essence, that state that I have it, if I move it works fine. If I rotate, the ray will be off by a little in the opposite direction of my rotation
<Groogy_> if I do not rotate, only translate then it works exactly like expected
unn4m3d10 has joined #crystal-lang
unn4m3d has quit [Ping timeout: 256 seconds]
straight-shoota has quit [Ping timeout: 245 seconds]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Ping timeout: 246 seconds]
That_Guy_Anon has quit [Quit: Leaving]
rohitpaulk has quit [Remote host closed the connection]
unn4m3d10 has quit [Ping timeout: 240 seconds]
unn4m3d10 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
heaven31415 has joined #crystal-lang
shalmezad has joined #crystal-lang
unn4m3d10 has quit [Ping timeout: 240 seconds]
unn4m3d10 has joined #crystal-lang
learod has joined #crystal-lang
unn4m3d has joined #crystal-lang
unn4m3d10 has quit [Ping timeout: 268 seconds]
unn4m3d has quit [Remote host closed the connection]
unn4m3d has joined #crystal-lang
straight-shoota has joined #crystal-lang
Papierkorb has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
unn4m3d has quit [Ping timeout: 264 seconds]
unn4m3d has joined #crystal-lang
heaven31415 has quit [Ping timeout: 276 seconds]
<crystal-gh> [crystal] RX14 closed pull request #5873: Fix a bug and make #read doc more clear in io.cr (master...master) https://git.io/vxuEk
heaven31415 has joined #crystal-lang
<heaven31415> I want to add another program example to the book, so people can feel better how it may look, is there something I should improve before making a PR? https://gist.github.com/Heaven31415/b69f52fa2992c4dcbcf1d8d74adb7911
unn4m3d has quit [Ping timeout: 265 seconds]
unn4m3d has joined #crystal-lang
straight-shoota has quit [Ping timeout: 265 seconds]
learod has quit [Remote host closed the connection]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Ping timeout: 256 seconds]
duane has joined #crystal-lang
learod has joined #crystal-lang
return0e has joined #crystal-lang
duane_ has joined #crystal-lang
straight-shoota has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.0.1]
straight-shoota has quit [Ping timeout: 265 seconds]
snsei has joined #crystal-lang
alex`` has joined #crystal-lang
straight-shoota has joined #crystal-lang
That_Guy_Anon has joined #crystal-lang
unn4m3d has quit [Ping timeout: 268 seconds]
unn4m3d has joined #crystal-lang
learod has quit [Remote host closed the connection]
duane has quit [Quit: Lost terminal]
snsei has quit [Ping timeout: 240 seconds]
heaven31415 has quit [Ping timeout: 248 seconds]
rohitpaulk has quit [Ping timeout: 240 seconds]
flaviodesousa has quit [Ping timeout: 256 seconds]
learod has joined #crystal-lang
heaven31415 has joined #crystal-lang
guilleiguaran has joined #crystal-lang
learod has quit []
duane has joined #crystal-lang
duane has quit [Client Quit]
FromGitter has quit [Remote host closed the connection]
oprypin has quit [Quit: Bye]
FromGitter has joined #crystal-lang
oprypin has joined #crystal-lang
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #crystal-lang
heaven31415 has quit [Ping timeout: 264 seconds]
<FromGitter> <builtap_twitter> @heaven31415 When looking into stdio I wanted to find the equivalent of python's `sys.stdin.buffer` read/write, also how to call a native app via a subprocess...
rohitpaulk has joined #crystal-lang
moei has quit [Quit: Leaving...]
unn4m3d has quit [Ping timeout: 276 seconds]
unn4m3d has joined #crystal-lang
heaven31415 has joined #crystal-lang
candle_ has joined #crystal-lang
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
return0e has quit [Read error: No route to host]
return0e has joined #crystal-lang
return0e has quit [Read error: No route to host]
return0e has joined #crystal-lang
return0e has quit [Ping timeout: 256 seconds]
<FromGitter> <bew> @builtap_twitter for stdin you can use `STDIN`, it's an IO object
straight-shoota has quit [Ping timeout: 256 seconds]
straight-shoota has joined #crystal-lang
<FromGitter> <bew> And
<FromGitter> <bew> And for the subprocess, checkout `Process`
That_Guy_Anon has quit [Quit: Leaving]
That_Guy_Anon has joined #crystal-lang
straight-shoota has quit [Ping timeout: 276 seconds]
straight-shoota has joined #crystal-lang
moei has joined #crystal-lang
straight-shoota has quit [Ping timeout: 248 seconds]
straight-shoota has joined #crystal-lang
heaven31415 has quit [Remote host closed the connection]
straight-shoota has quit [Ping timeout: 264 seconds]
moei has quit [Read error: Connection reset by peer]
moei has joined #crystal-lang
straight-shoota has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.1]
straight-shoota has quit [Ping timeout: 240 seconds]
straight-shoota has joined #crystal-lang
<FromGitter> <ryankshah> How can I convert a string to Array(Int8)?
<FromGitter> <ryankshah> Will `"xyz".bytes` (which returns `Array(UInt8)`) be compatible with Array(Int8)?
<FromGitter> <ryankshah> I know there is `String.bytes` but that returns `Array(UInt8)`
<FromGitter> <ryankshah> I'm trying to do this: https://gist.github.com/ryankshah/26f6e978438a63b3fc2c6e321b1cabae
candle_ has quit [Remote host closed the connection]
<FromGitter> <bararchy> @ryankshah "string". to_slice.to_a
<FromGitter> <ryankshah> @bararchy Even doing that I still get the same error:
<FromGitter> <bararchy> what error?
<FromGitter> <ryankshah> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5abaa6e4c4d0ae80070a01e4]
<FromGitter> <bararchy> yeha, you need `31_u8` and `.to_u8` on any ints
<FromGitter> <ryankshah> Cheers ^
That_Guy_Anon has quit [Quit: Leaving]
<FromGitter> <ryankshah> @bararchy Is there a crystal equivalent of https://www.tutorialspoint.com/java/lang/system_arraycopy.htm ?
heaven31415 has joined #crystal-lang
<FromGitter> <bararchy> I reacon `new_array = old_array[0..50]`
<FromGitter> <bararchy> Etc..
<FromGitter> <bararchy> This will create new arry with index 0 to 50 of old array
<FromGitter> <bararchy> You can do any range [8..10]
<FromGitter> <bararchy> Etc..
<FromGitter> <ryankshah> Maybe this would be a good extension to `Array#dup`
<FromGitter> <bararchy> @ryankshah BTW instead of `(0..bytes.size).each do` you can do `bytes.each_with_index do |byte, index|`
<FromGitter> <bararchy> Then index is the placement and the byte is the byte
<FromGitter> <ryankshah> @bararchy so my original will be come this new block? See https://gist.github.com/ryankshah/24da357d13ae0b0d47d154ca401f0ed2
<FromGitter> <bararchy> Or even `byets.size.times do |counter|` where counter increment every time it iteration
<FromGitter> <ryankshah> what would be better do you suggest?
t0nyaway is now known as t0nyandre
<FromGitter> <bew> The each_with_index is clearer to me
<FromGitter> <bew> (in your gist)
<FromGitter> <ryankshah> Okay cool, thanks :)
<FromGitter> <bew> And you can even use `map_with_index` to change each element with the value from the block
<FromGitter> <ryankshah> Example?
<FromGitter> <ryankshah> What would be faster actually*
<FromGitter> <ryankshah> Also I'm trying to recreate this java code: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5abaaaf82b9dfdbc3a2b83b6]
<FromGitter> <bew> Not faster, or slower, it would be the same, just clearer in semantic
<FromGitter> <ryankshah> Ahh that's agreeable
<FromGitter> <bew> Or just `map` since you don't need the index anymore
<FromGitter> <ryankshah> > Also I'm trying to recreate this java code: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ where the arraycopy is the function i asked above earlier and bytes is the original `String.to_s.to_a` [https://gitter.im/crystal-lang/crystal?at=5abaab41e3d0b1ff2c743552]
<FromGitter> <bew> What are you actually trying to do? (at a higher level)
<FromGitter> <ryankshah> Implement Murmurhash
<FromGitter> <ryankshah> I'm trying to put the original bytes at the offset
<FromGitter> <bew> Did you tried to follow the algorithm on wikipedia, or even the C implementation? (https://en.m.wikipedia.org/wiki/MurmurHash) it might be easier to copy to crystal than the Java one i think
<FromGitter> <ryankshah> Its not actually a hard conversion from Java, its just the copy function for putting the original bytes at the offset that I am having trouble with
<FromGitter> <bew> Hmm yes maybe, I'm just wondering why you need to replace some bytes.. A hash function will calculate a hash right? It shouldn't mutate anything?
<FromGitter> <bew> (and a hash is just a number iirc)
<FromGitter> <ryankshah> Its for the test
<FromGitter> <ryankshah> Not for the actual function :)
<FromGitter> <bew> Ah x) makes more sense
<FromGitter> <ryankshah> Yeah! Should have mentioned this xD
<FromGitter> <ryankshah> Like once I get this offset copy thing figured out, I can fully test my x32 implementation
<FromGitter> <bew> So you have a string and you want to replace a part of it right?
<FromGitter> <ryankshah> I had a string and originally converted it to the Int8 array
<FromGitter> <ryankshah> Now I want to create a copy of this original array and put the original bytes from the original array at the offset position
<FromGitter> <bew> Hmm I don't think an array is good here, maybe a slice is enough. Why did you convert to array?
<FromGitter> <ryankshah> Because my implementation is using `Array`s originally, but even using `Slice` I still encounter the same issue.
<FromGitter> <bew> Using a Slice is easier to manipulate memory areas, with for example: https://crystal-lang.org/api/0.24.2/Slice.html#copy_from%28source%3Aself%29-instance-method
<FromGitter> <ryankshah> That is pretty similar to `dup`
shalmezad has quit [Quit: Leaving]
<FromGitter> <ryankshah> But again, even with the easier way to manipulate memory i still have the same problem of not figuring out how to do what I need
<FromGitter> <bew> Well dup will create a duplicate of an object, not part of it
<FromGitter> <bew> I'm sorry I don't reply directly to your question, I hope you won't take it wrong
<FromGitter> <ryankshah> It's okay, I prefer to try figure it out myself before asking for help and showing what I have tried :)
<crystal-gh> [crystal] straight-shoota opened pull request #5878: Fix typo in IO doc (master...patch-1) https://git.io/vxgoA
<FromGitter> <bew> So the 2 java lines are actually creating a new 'array' of byte, bigger than `bytes` by `offset`, then copy the content of `bytes` to the end of the new 'array'
<FromGitter> <bew> Not the end, but on the right until the end
<FromGitter> <ryankshah> Oh okay that makes a bit more sense..
return0e has joined #crystal-lang
<FromGitter> <bew> So here you could do `new = Bytes.new(bytes.size + offset)` then `bytes.copy_to(new + offset)`
<FromGitter> <bew> (can't try right know, I'm on my phone, but it should be it)
<FromGitter> <ryankshah> would it be `bytes.copy_to(new + offset)`?
duane_ has quit [Ping timeout: 276 seconds]
<FromGitter> <ryankshah> Also I think I would be using `newarray = Array(Int8).new(bytes.size + offset)`
<FromGitter> <bew> Yeah that shoukd do it
<FromGitter> <bew> I'd suggest you to use Bytes instead of Array though for your implementation
<FromGitter> <ryankshah> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5abab5cdbb1018b37a30740c]
<FromGitter> <ryankshah> Do I use `offset.to_u8`?
<FromGitter> <bew> I was assuming `bytes` was a slice
<FromGitter> <bew> (or Bytes)
<FromGitter> <ryankshah> Oh no its Array(Int8)
<FromGitter> <ryankshah> Maybe I should switch this up to Slice
<FromGitter> <bew> Yeah, Array is not made for this kind of manipulations
<FromGitter> <ryankshah> Okay I'll use `Bytes` since its a `Slice` type
unn4m3d has quit [Ping timeout: 264 seconds]
unn4m3d has joined #crystal-lang
heaven31415_ has joined #crystal-lang
heaven31415 has quit [Ping timeout: 264 seconds]
duane has joined #crystal-lang
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
heaven31415_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
hightower2 has joined #crystal-lang
hightower3 has quit [Ping timeout: 240 seconds]
heaven31415 has joined #crystal-lang
<heaven31415> if I have a generic type, can I write a method specialization so method #foo of this type will act differently based on generic type?
<FromGitter> <bew> Not yet iirc, there's an open issue for this
straight-shoota has quit [Read error: Connection reset by peer]
<heaven31415> right, I found it, thanks
straight-shoota has joined #crystal-lang
emancu has joined #crystal-lang
heaven31415 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
emancu has quit [Client Quit]
return0e has quit [Read error: No route to host]
unn4m3d has quit [Ping timeout: 264 seconds]
unn4m3d has joined #crystal-lang