ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.0 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
balduin has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <codenoid> sir, why i got the error when i add more condition, ⏎ ⏎ ``` if dbfile.includes? ".txt" && wperm == "y"``` [https://gitter.im/crystal-lang/crystal?at=59559ce38dae4250316adf57]
<FromGitter> <codenoid> is .includes need to close ?
<FromGitter> <codenoid> wait, i'll try with ()
<FromGitter> <codenoid> :sparkles:
<FromGitter> <johnjansen> thats what you need
<FromGitter> <codenoid> better with `` File.extname(dbfile) == ".txt" `` sir ^^
ragmaanir has quit [Quit: Leaving]
<FromGitter> <Ragmaanir> hi, i got a problem here (description inside): https://carc.in/#/r/29x2
<FromGitter> <johnjansen> @codenoid sure, if thats what you are trying to do, then use extname, the original code didnt either stipulate a requirement or an intention, it was simply a “why doesnt this work” … which was because of the lack of `()` in that case
<FromGitter> <johnjansen> everyone is happy to help, but try to state your problem in a clear and concise way such that anyone can assist you
<FromGitter> <codenoid> ok sir ^^
<FromGitter> <johnjansen> oh and you dont need to call everone sir ;-) we are all equal
Orbixx has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
Orbixx has quit [Quit: leaving]
<FromGitter> <codenoid> why every i run my compiled crystal app in other computer, i got this error ⏎ `` ` ⏎ ./client: error while loading shared libraries: libgc.so.2: cannot open shared object file: No such file or directory ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=5955c4cfc101bc4e3a367a8d]
<FromGitter> <codenoid> why every i run my compiled crystal app in other computer, i got this error ⏎ ``./client: error while loading shared libraries: libgc.so.2: cannot open shared object file: No such file or directory``
<FromGitter> <codenoid> crystal 0.22, same os, ⏎ ⏎ ```require "kemal" ⏎ require "kemal-session" ⏎ require "option_parser"``` [https://gitter.im/crystal-lang/crystal?at=5955c512ad9c781843b57407]
<FromGitter> <johnjansen> this is not my area of expertise, but i would expect this is because `libgc` is not on the other machine
<FromGitter> <codenoid> i mean why my crystal app need that library
<FromGitter> <johnjansen> its the GC http://www.hboehm.info/gc/
sz0 has joined #crystal-lang
Dreamer3 has joined #crystal-lang
<FromGitter> <codenoid> apt update > install ⏎ than ``Crystal 0.22.0 [3c71228] (2017-04-20) LLVM 3.5.0 `` in my computer ⏎ and ``Crystal 0.23.0 [3c3d3e2] (2017-06-28) LLVM 3.8.1 `` in my vps ⏎ :worried: [https://gitter.im/crystal-lang/crystal?at=5955c9fc5a1ab55f643d01b3]
<FromGitter> <codenoid> `` Err:20 https://dist.crystal-lang.org/apt crystal InRelease ⏎ The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4EBAC6667697DD2 ``
hako has joined #crystal-lang
hako has quit [Ping timeout: 268 seconds]
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
hako has joined #crystal-lang
hako has quit [Ping timeout: 240 seconds]
hako has joined #crystal-lang
hako has quit [Read error: Connection reset by peer]
hako has joined #crystal-lang
hako has quit [Read error: Connection reset by peer]
hako has joined #crystal-lang
<FromGitter> <schoening> Ugh.. why did I have to watch a few videos on cpu cache misses.. Now I feel bad about using oop :p
<FromGitter> <schoening> @Papierkorb btw I was able to embed lua in c. Was a fun exercise.
<FromGitter> <codenoid> still stuck with gcc on my ubuntu vps, and my stackoverflow question limit reached
<FromGitter> <codenoid> ups, but not in askubuntu
hako has quit [Ping timeout: 260 seconds]
<FromGitter> <sdogruyol> @codenoid ⏎ ⏎ ```sudo apt-get update ⏎ sudo apt-get install libgc-dev``` [https://gitter.im/crystal-lang/crystal?at=5955e6f0a42fa68a30846158]
<FromGitter> <sdogruyol> have you tried this?
<FromGitter> <sdogruyol> you are missing libgc
<FromGitter> <codenoid> yes
<FromGitter> <codenoid> but, i think the app pointed to wrong directory
<FromGitter> <faustinoaq> @akzhan I added experimental support of Scry (https://github.com/faustinoaq/vscode-crystal-lang#server-new) to my extension, if someone has a Mac computer, can compile This (https://github.com/faustinoaq/scry) repo and send me the scry binary as *7z* + SHA checksum in a PR.
<FromGitter> <faustinoaq> @tarvit I use GDB to debug crystal code in VSCode https://github.com/faustinoaq/vscode-crystal-lang#debugging
<FromGitter> <faustinoaq> It works pretty well
<FromGitter> <faustinoaq> ((http://i.imgur.com/tOIEqlo.png))
<FromGitter> <sdogruyol> @faustinoaq awesome
<FromGitter> <faustinoaq> @sdogruyol Yes, it's also works with D and Rust https://github.com/WebFreak001/code-debug
<FromGitter> <schoening> is it a bad idea to have an object have a property that is a struct?
<FromGitter> <schoening> instead of that struct being a class I mean
<FromGitter> <sdogruyol> Nope
<FromGitter> <sdogruyol> If it's immutable it's okay
<FromGitter> <schoening> Ahhh ok because of passing it.
<FromGitter> <schoening> I was just asking because it says structs are kept on the stack. So idk. seems like when I have a thousand objects all with structs that the stack would be filled up?
<FromGitter> <sdogruyol> Nope
<FromGitter> <sdogruyol> Structs are better than classes for performance
hightower4 has quit [Ping timeout: 260 seconds]
<hightower2> Can anyone explain why? From the text looks like structs are passed by value, and I don't understand how passing by value can be faster than passing a pointer?
<FromGitter> <schoening> cool ty @sdogruyol
<crystal-gh> [crystal] MakeNowJust opened pull request #4638: init: add TODO doc-comment for generated module (master...fix/crystal-init/todo-comment-for-doc) https://git.io/vQ4ie
hightower4 has joined #crystal-lang
<FromGitter> <sdogruyol> `Stack is used for static memory allocation and Heap for dynamic memory allocation, both stored in the computer's RAM . Variables allocated on the stack are stored directly to the memory and access to this memory is very fast, and it's allocation is dealt with when the program is compiled.` @hightower2
<hightower2> sdogruyol: right, but when you pass by value, the value needs to be copied/allocated?
<FromGitter> <sdogruyol> it's at compile time
<FromGitter> <sdogruyol> in the end it's a static memory allocation
<FromGitter> <codenoid> @elorest hi sir, i just upload my code, but my readme.md file wasnt updated ;) ⏎ https://github.com/codenoid/ficha
<FromGitter> <codenoid> +1 feature, server - client, like ssh, static secret key, storage, sqlite and text plain, with encrypted value
<FromGitter> <codenoid> and it wasnt 100% finish to make a new version :smile: :+1:
fmcevoy has joined #crystal-lang
flaviodesousa has joined #crystal-lang
hightower3 has joined #crystal-lang
hightower2 has quit [Read error: Connection reset by peer]
<FromGitter> <codenoid> ups, sorry for the link @elorest ,, > https://github.com/codenoid/ficha
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
bjz has joined #crystal-lang
Philpax has joined #crystal-lang
<hightower3> Hey, I want to define a function like: def myfunc( variable, value), and when this executes I want to compare value of @variable with value. Am I right in thinking that since there is no #send, the only way to do this is to switch( variable) and 'case' each possible value?
<hightower3> s/possible value/possible variable name/
txdv has quit [Ping timeout: 246 seconds]
<hightower3> s/switch...case/case...when/
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
saadq has quit [Ping timeout: 258 seconds]
saadq has joined #crystal-lang
<FromGitter> <bew> you could solve this with a macro imo
<FromGitter> <bararchy> Is anyone up for making bindings to fann (Fast Artificial Neural Network) ?
balduin has quit [Ping timeout: 255 seconds]
<FromGitter> <krypton97> Why doesn't crystal support * and & operatots for working with pointers?
Nouv has joined #crystal-lang
<FromGitter> <straight-shoota> maybe rather https://crystal-lang.org/docs/syntax_and_semantics/pointerof.html
<FromGitter> <krypton97> Yeah, I know about that, *p = &r is shorter but pointerof is more readable
balduin has joined #crystal-lang
<FromGitter> <sdogruyol> it's a preference you know
<FromGitter> <straight-shoota> plus, * and & are already used for splats and blocks like in Ruby
<FromGitter> <krypton97> Ikr
<FromGitter> <krypton97> What's recommended to use? pointerof() or malloc?
<FromGitter> <bararchy> I got this func ⏎ ⏎ ``` my_array = [1,2,3,4,5] ⏎ create_standard_array(my_array.size, my_array)``` ⏎ ⏎ or should I use pointerof or something ? [https://gitter.im/crystal-lang/crystal?at=595639ee5a1ab55f643ee8af]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <krypton97> Are you looking to create a fixed sized array?
<FromGitter> <bararchy> Seems so, but using static array wont help , I somehow need to pass in UInt* which represents an array
<FromGitter> <Ragmaanir> can anybody help me with this problem: https://carc.in/#/r/29x2 ? i need to specify the type of a instance variable because it is initialized lazily. but the type is determined by a macro and it looks like i cannot put that type in "@a : T". The only way to solve this might be to use a macro that delegates to `run` i think.
snsei has joined #crystal-lang
balduin has quit [Ping timeout: 240 seconds]
hightower2 has joined #crystal-lang
hightower3 has quit [Ping timeout: 260 seconds]
<FromGitter> <bew> @bararchy you could use `my_array.map(&.to_u)` then the compiler will automatically call `Array#to_unsafe` which will pass a pointer to the fun
<FromGitter> <bew> Notice that the array you pass to the fun may be collected by the GC, you should save it in user-land until the array's not needed
<FromGitter> <bew> s/user/crystal
snsei has quit [Remote host closed the connection]
<crystal-gh> [crystal] MakeNowJust opened pull request #4641: Makefile: fix to work 'make help' when using Makefile.local (master...fix/makefile/help-work-when-use-makefile-local) https://git.io/vQBqY
snsei has joined #crystal-lang
snsei has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
<FromGitter> <Ragmaanir> btw anyone tried out visual studio with crystal? how is it? any suggestions for plugins?
<FromGitter> <sdogruyol> VS Code
<FromGitter> <sdogruyol> @faustinoaq s plugin is great
<FromGitter> <Ragmaanir> yeah, thats the one i picked
<FromGitter> <sdogruyol> cool
<FromGitter> <mverzilli> I've been using VSCode to write Crystal for ~1 year now
<FromGitter> <mverzilli> I love it, and I even didn't have time to use Faustino's extension yet
<FromGitter> <mverzilli> done! thanks for the nudge
<FromGitter> <sdogruyol> anytime!
<crystal-gh> [crystal] MakeNowJust opened pull request #4643: Explain 'crystal tool expand' in crystal(1) man page (master...fix/man/add-tool-expand) https://git.io/vQBm4
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<FromGitter> <faustinoaq> Hi crystal community!, new version of Scry (Language Server Protocol for Crystal) is here :point_right: https://github.com/kofno/scry
<FromGitter> <sdogruyol> :+1:
<FromGitter> <faustinoaq> Scry works with Nuclide (@KeplerS confimed this) and VSCode, but if you want support other editor, just configure this :point_right: https://github.com/kofno/scry/blob/master/src/scry/protocol/settings.cr#L19
<FromGitter> <faustinoaq> The gif above is a bit slow, because my computer is slow :sweat_smile: (Old Intel Celeron)
<FromGitter> <mverzilli> Faustino you're building some amazing stuff :)
<crystal-gh> [crystal] mverzilli pushed 1 new commit to master: https://git.io/vQBnR
<crystal-gh> crystal/master cb0ee67 TSUYUSATO Kitsune: Explain 'crystal tool expand' in crystal(1) man page
hightower2 has quit [Ping timeout: 268 seconds]
<FromGitter> <bararchy> Does sublime support this ?
<FromGitter> <faustinoaq> Thanks!, I hope Crystal tool adds more features to improve code development :smile: :point_right: https://github.com/kofno/scry/blob/master/src/scry/protocol/server_capabilities.cr#L10
<FromGitter> <faustinoaq> @bararchy I think so, you can see http://langserver.org/ and configure Scry with your client here :point_right: https://github.com/kofno/scry/blob/master/src/scry/protocol/settings.cr#L19
bjz has joined #crystal-lang
<travis-ci> crystal-lang/crystal#cb0ee67 (master - Explain 'crystal tool expand' in crystal(1) man page): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/248800451
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
balduin has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
<FromGitter> <straight-shoota> I might checkout VS code soon ;)
Nouv has quit [Quit: Nouv]
<FromGitter> <faustinoaq> :smile: Remember to turn on the features on your settings.json, because They're disabled by default (some performance issues, I have a old machine :sweat_smile: )
<travis-ci> crystal-lang/crystal#cb0ee67 (master - Explain 'crystal tool expand' in crystal(1) man page): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/248800451
snsei has joined #crystal-lang
grottof has joined #crystal-lang
grottof has left #crystal-lang [#crystal-lang]
sz0 has quit [Quit: Connection closed for inactivity]
<travis-ci> crystal-lang/crystal#cb0ee67 (master - Explain 'crystal tool expand' in crystal(1) man page): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/248800451
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
greengriminal has joined #crystal-lang
<FromGitter> <faustinoaq> @elorest I just tried Scry (https://github.com/kofno/scry) and works very good :smile: ⏎ ⏎ Imgur (http://i.imgur.com/hCWLtg9.png)
<FromGitter> <faustinoaq> NeoVim Client Plugin for Language Server Protocol :point_right: https://github.com/autozimu/LanguageClient-neovim
<crystal-gh> [crystal] MakeNowJust opened pull request #4646: String: rename `split` without separator to `words` (master...fix/string/split-without-separator-ranames-words) https://git.io/vQBwt
greengriminal has quit [Quit: Leaving]
greengriminal has joined #crystal-lang
Renich has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
Renich_ has joined #crystal-lang
<FromGitter> <bew> @faustinoaq how did you configured it?
Renich has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> Completion works?
Philpax has quit [Ping timeout: 260 seconds]
<FromGitter> <krypton97> any react js developers here :)?
Renich_ is now known as Renich
Renich has quit [Quit: Renich]
Renich has joined #crystal-lang
<FromGitter> <fridgerator> <- vue.js
fmcevoy has quit [Ping timeout: 276 seconds]
Cyrus has joined #crystal-lang
<FromGitter> <elorest> All of my travis tests fail since the new version of crystal came out.
<Yxhuvud> RIP
<FromGitter> <fridgerator> is travis pulling the right crystal version?
<FromGitter> <elorest> I don’t think so.
<FromGitter> <elorest> I don’t see a way to specify the version for travis. https://docs.travis-ci.com/user/languages/crystal/
<FromGitter> <elorest> shard.yml is still set to 0.22.0
<FromGitter> <elorest> @faustinoaq What about normal vim?
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
xiljin has quit [Ping timeout: 276 seconds]
<FromGitter> <straight-shoota> @elorest judging by https://github.com/crystal-lang/crystal/commit/3c3d3e2b830e81de0aa39b7af0cd6f82f759c410#commitcomment-22856818 it seems travis can't install the current release because the publickey of the crystal package source has changed
xiljin has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
<FromGitter> <mgarciaisaia> :wave: Hi everyone! Trying to fix up all the mess that came with the release :)
<FromGitter> <mgarciaisaia> I know very little about GPG, so if anyone feels you could help me get an insight of how to solve the issue, please don't be shy
<FromGitter> <mgarciaisaia> The Debian release was made with a brand new subkey of the GPG key that has been used up until 0.22.0. I really hoped that the subkey, being generated by the master one, would be equally trusted - but it seems it isn't. Last night I've `gpg --export`ed the pubkey an published it to keys.gnupg.net, just in case, but it doesn't seem to be enough. ⏎ Am I missing something?
<FromGitter> <drosehn> I'm afraid that I have such a limited and vague understanding of GPG that I'd be more likely to send you in the wrong direction.
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
<FromGitter> <elorest> @mgarciaisaia Thanks. If I have any insights I’ll let you know.
<FromGitter> <elorest> @straight-shoota Yeah that looks like the same issue. Thanks
<FromGitter> <mgarciaisaia> We'll *eventually* make Travis honor the picked Crystal version, too - but, for now, the Debian repo only contains the latest Crystal version, so you couldn't install a past version even if you wanted to.
sz0 has joined #crystal-lang
snsei has joined #crystal-lang
hightower2 has joined #crystal-lang
tilpner_ has joined #crystal-lang
tilpner has quit [Quit: :wq]
tilpner_ is now known as tilpner
ChickeNES has quit [Ping timeout: 240 seconds]
ChickeNES has joined #crystal-lang
Renich has quit [Quit: Renich]
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
snsei has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
balduin has quit [Ping timeout: 246 seconds]
snsei has quit [Remote host closed the connection]
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
balduin has joined #crystal-lang
<crystal-gh> [crystal] asterite opened pull request #4649: Fix #4639: Macro lookup from included module broken (master...fix/4639-macro-lookup-from-included-module) https://git.io/vQROW
<FromGitter> <hyanmandian> Hey guys, I trying to use travis for CI, but i receive some errors...
<FromGitter> <bararchy> How comes ⏎ a = Array(Float32).new(5, 0.1_f32)
<FromGitter> <hyanmandian> I found a issue opens on github, but without answers
<FromGitter> <hyanmandian> Has anyone ever experienced this?
<FromGitter> <straight-shoota> see posts above
<FromGitter> <hyanmandian> HAHAHA nice... I have not seen it :( Thanks!
<FromGitter> <bararchy> How comes that ⏎ ⏎ ```a = Array(Float32).new(5, 0.1_f32) ⏎ a.to_unsafe.value # => 0.1 ``` ⏎ ⏎ Where I would expect it to be `[0.1, 0.1, 0.1, 0.1, 0.1]` [https://gitter.im/crystal-lang/crystal?at=5956c4065a1ab55f64418126]
<FromGitter> <straight-shoota> `to_unsafe` returns a pointer to the first array item
<FromGitter> <bararchy> Oh, how can I return a pointer to the whole array ?
<FromGitter> <straight-shoota> you don't
<FromGitter> <bararchy> Hm...
<FromGitter> <straight-shoota> an array is represented as a pointer to the first item plus its size
<FromGitter> <bararchy> I see, then how can I get the whole array back ?
<FromGitter> <bararchy> and it needs an Array, I also recive an Array pointer from this back, and I'm not sure how print it
<FromGitter> <straight-shoota> use a slice: https://crystal-lang.org/api/0.23.0/Slice.html
<FromGitter> <mverzilli> or maybe you can use: https://crystal-lang.org/api/0.23.0/Array.html#build%28capacity%3AInt%2C%26block%29%3Aself-class-method
<oprypin> good idea, that's what i think it wants - a preallocated buffer
<FromGitter> <bararchy> Interesting :)
<FromGitter> <bararchy> Ok, so the issue is that The lib will create the array , so I can't use the array build or slice, I only get a pointer to the first member, I do know how long the array is, can I use that to enumerate values ?
<FromGitter> <bararchy> or something ?
<FromGitter> <bararchy> Is there a Pointer.next or something haha
<oprypin> bararchy, ... have you even used this library in C?
<FromGitter> <bararchy> Nope, Used the binding in Ruby, now trying to port to Crystal
<FromGitter> <bararchy> but I got the full docs
<FromGitter> <bararchy> it's just that I don't have too much expirenace in C and low level memory\pointer play
<oprypin> please show an example of usage of this
<FromGitter> <straight-shoota> this should handle the case where you get a pointer and size: `Slice.new(pointer, size).to_a`
<oprypin> but you don't
baweaver is now known as baweaver_away
<FromGitter> <bararchy> I do, I have a pointer and I know the maximum size
<FromGitter> <bararchy> which is the number of output neurons the FANN was initiated with
<FromGitter> <bararchy> @straight-shoota Thanks, this might be it
<FromGitter> <bararchy> Yap, working :) ⏎ Thanks
<oprypin> really
<FromGitter> <bararchy> now I get the array as needed
<FromGitter> <bararchy> Yap, got back a perfect MSE , thanks @straight-shoota
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <codenoid> readme update https://github.com/codenoid/ficha
<FromGitter> <bararchy> Got basic functionality working :) https://github.com/bararchy/crystal-fann
<FromGitter> <johnjansen> good work @bararchy
<FromGitter> <bararchy> I'll add it to the libs needed list
<FromGitter> <johnjansen> make sure you let the FANN author know, it should be in crystalshards.xyz already … its not really ‘needed’ anymore, since you have done it already ;-) excellent work
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]