ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.1 | 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
<crystal-gh> [crystal] Sija opened pull request #5438: Improve readability of Float::Printer::* docs (master...float-printer-docs-polish) https://git.io/vb9v6
Guest19095 has quit [Ping timeout: 260 seconds]
Guest19095 has joined #crystal-lang
happycoder has joined #crystal-lang
happycoder has quit [Read error: Connection reset by peer]
<hightower3> Can I make array from tuple without knowing type? I want to do somethin glike def x( *args) a = Array.new args end
<FromGitter> <jwaldrip> just to_a?
<FromGitter> <jwaldrip> any relation to kelsey there hightower3?
<hightower3> mm, not really
snsei has joined #crystal-lang
DTZUZU has quit [Quit: WeeChat 1.9]
DTZUZU has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<18VACZY6W> [crystal] Sija closed pull request #5018: Use `TypeNode#union_types` where possible (master...pr-4995-followup) https://git.io/vdvMj
<7GHABLZYP> [crystal] Sija reopened pull request #5018: Use `TypeNode#union_types` where possible (master...pr-4995-followup) https://git.io/vdvMj
Guest19095 has quit [Ping timeout: 256 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 248 seconds]
Guest19095 has joined #crystal-lang
snsei has joined #crystal-lang
Guest19095 has quit [Ping timeout: 252 seconds]
snsei has quit [Ping timeout: 240 seconds]
hightower3 has quit [Remote host closed the connection]
Guest19095 has joined #crystal-lang
Guest19095 has quit [Ping timeout: 256 seconds]
Guest19095 has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
DTZUZU has quit [Ping timeout: 248 seconds]
DTZUZU has joined #crystal-lang
aroaminggeek has joined #crystal-lang
<txdv> Multi-threadingRework the fiber scheduler to handle multiple threads in parallel
<txdv> a shiiiiiiiiit
Ven`` has joined #crystal-lang
flaviodesousa has joined #crystal-lang
Ven`` has quit [Read error: No route to host]
Ven`` has joined #crystal-lang
aroaminggeek has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <sdogruyol> What?
claudiuinberlin has joined #crystal-lang
Ven`` has quit [Ping timeout: 248 seconds]
<FromGitter> <bew> txdv what?
<txdv> multi threading stuff being worked on
<txdv> that is awesome!
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
<FromGitter> <marin117> hi everyone
<FromGitter> <marin117> anybody know how to insert postgres range with crystal since ranges use quotes to insert (range has to be inserted with parameteres)
<FromGitter> <marin117> something like this
<FromGitter> <marin117> insert into ..... values ( '[$1, $2)')
<FromGitter> <marin117> SQL query takes literal not parameters if I put quotes like this
sz0 has quit [Quit: Connection closed for inactivity]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
<crystal-gh> [crystal] RX14 pushed 2 new commits to master: https://git.io/vb9Km
<crystal-gh> crystal/master 910b555 Benoit de Chezelles: Fix formatting of lib's fun starting with uppercase letter
<crystal-gh> crystal/master 4932360 Benoit de Chezelles: Add formatter spec for uppercased fun call
Guest19095 has quit [Ping timeout: 256 seconds]
snsei has quit [Remote host closed the connection]
Guest19095 has joined #crystal-lang
<RX14> btw: just spoke to txe and he knows of the new windows port he's just very busy
<travis-ci> crystal-lang/crystal#4932360 (master - Add formatter spec for uppercased fun call): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/320182253
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter> <sdogruyol> @RX14 awesome, haven't seem him around for a while
Guest19095 has quit [Ping timeout: 256 seconds]
<RX14> well we're all just going to be copying code from his windows port fork lol
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vb918
<crystal-gh> crystal/master 3a5fde0 Chris Hobbs: Always print backtrace on error inside fork (#5431)
Guest19095 has joined #crystal-lang
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<FromGitter> <bew> @RX14 what do you mean "far beyond 1G" at https://github.com/crystal-lang/crystal/issues/5439#issuecomment-353592176 what will tale the rest of the place?
<FromGitter> <bew> take*
<RX14> it's a slice
<RX14> .to_s is Bytes[123, 456, 435]
<RX14> as a string
<RX14> it's turning one byte into 5
<RX14> and thats why it's absolutely not what he wants
<FromGitter> <bew> Oh yes right ˆˆ
<Guest19095> helu all
<Guest19095> @asterite
<Guest19095> ar yuo there
Ven`` has joined #crystal-lang
<RX14> Guest19095, what do you want to ask
<Guest19095> i want @asterite signature in my shirt
<FromGitter> <bew> ...
<travis-ci> crystal-lang/crystal#3a5fde0 (master - Always print backtrace on error inside fork (#5431)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/320202998
<Papierkorb> bew, don't worry, you never run out of hearing uncommon requests :)
happycoder has joined #crystal-lang
Ven`` has quit [Ping timeout: 256 seconds]
<FromGitter> <mverzilli> I'll pass the request onto him :D
<FromGitter> <sdogruyol> lol :D
<Guest19095> thank @mverzilli :D
<FromGitter> <sdogruyol> why especially from Ary though :D
happycoder has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
<greenbigfrog> @db.transaction do |tx|
<greenbigfrog> db = tx.connection
<greenbigfrog> db.exec("SELECT * FROM ...")
<greenbigfrog> end
<greenbigfrog> any way I can the second line, without having to use `tx.connection.exec`?
<greenbigfrog> *avoid
<FromGitter> <bew> Which db shard are you using?
<RX14> greenbigfrog, you can just do tx.exec
<RX14> since transaction implements querymethods
<RX14> iirc
<greenbigfrog> no.no.
<greenbigfrog> `undefined method 'exec' for DB::TopLevelTransaction`
<greenbigfrog> using pg
<RX14> huh
<RX14> i could have sworn it was different
<Guest19095> bcoz i wannabe like ary @sdogruyol
<FromGitter> <sdogruyol> that's cool :)
<greenbigfrog> so, is there a better way? RX14
<RX14> aparrently not
<greenbigfrog> ok
happycoder has joined #crystal-lang
<literal> greenbigfrog: crystal-sqlite3?
<greenbigfrog> no. pg
<literal> and @db is the value returned by DB.open ?
happycoder has quit [Remote host closed the connection]
happycoder has joined #crystal-lang
<literal> if so, you could do "@db = DB.connect..." instead, then use @db inside your transaction
<greenbigfrog> yeah. still need to use transactions though, so that ain't gonna work
<literal> why not?
<literal> @db.transaction do { |tx| @db.exec "select ..." }
<literal> works for me
<greenbigfrog> hm. ok
<greenbigfrog> thanks
<literal> there's only one transaction per connection so it works
<greenbigfrog> true
<literal> well, they could also be nested, but not interleaved, so it's fine
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <jwaldrip> okay... im going to sound like a broken record... looking like a 0.24.1 release today?
<FromGitter> <jwaldrip> I would love to have the official docker image rather than having to build my own.
<Papierkorb> It's already in the arch repo
<RX14> it's unlikely to happen today
<RX14> given its friday
<FromGitter> <bew> Grrr
imarobot has joined #crystal-lang
<RX14> it's fustrating me as much as you
<RX14> i'm ready to go
<imarobot> how do I add content to a file without overwritting the whole file? I tried File.open("file.txt", "a") and then File.write("file.txt", "hello")
<RX14> as far as i'm concerned it should have been released a week ago if it was my decision
<RX14> @imarobot, File.open("file.txt", "a") should work
<imarobot> but i did that. And then File.write("file.txt", "hello") and then he is just overwritting it
<FromGitter> <sdogruyol> @imarobot https://play.crystal-lang.org/#/r/3a3r
<RX14> File.open doesn't affect File.write
<RX14> File.open returns a File object
<RX14> then you use that object to do the writing
<imarobot> ooh now i understand
<imarobot> thanks very much
<FromGitter> <sdogruyol> `a` also works btw
<RX14> honestly File.write is usually a crutch
<RX14> i wonder what the concensus is for removing it
<RX14> probably "nooo"
<FromGitter> <sdogruyol> I'm not sure about that
<FromGitter> <sdogruyol> don't prefer it myself though
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<imarobot> but isnt it a bit "inefficient" if you need to reopen the file again every time you want to write to it again?
<RX14> imarobot, you don't need to...
<RX14> imarobot, File.write just calls File.open internally anyway
<RX14> but you can keep a File object around
<RX14> and write to it whenever you want
<RX14> then when you're done you call .close
<RX14> but if you can do it inside a block it's better because it calls .close automatically
<imarobot> but how do I use my opened file object in the file.write? or better file.puts?
<RX14> did you see @sdogruyol's example?
<RX14> he calls f.write inside the File.open block
<imarobot> yes i looked at it. He is always reopening it there
<RX14> that was a demonstration
<RX14> you could put all of that inside a File.open block
<imarobot> can I do File.write(myopenedfile) do |x| ?
<RX14> no
<imarobot> no but i need to open it again at different times
<RX14> ignore File.write
<RX14> it's not what you want
<imarobot> i also tried: file = File.open("myfile.txt", "a") ; file.puts "mytext"
<RX14> that should work
<imarobot> oh really?
<RX14> did you call .close ?
<RX14> or just do it in the block
<imarobot> no its not
<imarobot> its not working
<RX14> it does, i'll need to see your code to help you more
<imarobot> my entire code is this:
<imarobot> file = File.open("mytxt.txt", "a") file.puts "hello"
<RX14> yes
<RX14> i said you need to use either file.close
<RX14> or the block form of File.open
happycoder has quit [Ping timeout: 252 seconds]
<RX14> and I suggest you use the File.open with a block form
<imarobot> ok now its working with 100% accuracy perfectly fine. Thank you
<Yxhuvud> I don't use File.write all that often, but I do use File.read *all the time*. It is a great convenience method.
happycoder has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
happycoder has quit [Ping timeout: 248 seconds]
DTZUZO has quit [Quit: WeeChat 2.0]
<imarobot> what does the cost at Crypto::Bcrypt::Password.create("password123", cost: 11) means? the higher, the safer will it be encoded?
<Guest19095> *higher is slower too
<Guest19095> not encoded, but encrypted
<imarobot> yes. I already noticed that its slower when the cost is higher. I will choose the highest because i need the highest safety
<FromGitter> <bew> @imarobot note that when it encrypt your password, it'll will block you whole program, other fibers won't be able to run (until we have true parallism though)
Guest19095 has quit [Quit: Leaving]
imarobot has quit [Ping timeout: 260 seconds]
<crystal-gh> [crystal] Sija opened pull request #5440: Complex enhancements (master...complex-enhancements) https://git.io/vbHYI
codenoid has joined #crystal-lang
<FromGitter> <paulcsmith> I'm running into some issues connecting to Google over SSL. Here's the gist: https://gist.github.com/paulcsmith/21d34f079525c669b1f4ada4746579ad
<FromGitter> <paulcsmith> Does anyone has some ideas? The error I get is: SSL_connect: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
<FromGitter> <paulcsmith> I've been working on this for a couple days and haven't figured out why it won't work. It also doesn't work on Heroku. I'm on macOS High Sierra. Anyone seen this before?
olbat has quit [Ping timeout: 240 seconds]
<FromGitter> <paulcsmith> An insecure SSL context "works"...but is insecure :S `OpenSSL::SSL::Context::Client.insecure`
<FromGitter> <marksiemers> Until parallelism is done, is there a shard that does messaging, similar to RabbitMQ? Could that give some functionality of parallelism using process forking?
<FromGitter> <aroaminggeek> @RX14 just read your recent comments over at ycombinator RE: crystal's status. Thanks for the transparency, and honest and well stated remarks.
<RX14> thanks
<FromGitter> <fridgerator> @paulcsmith on mac?
<FromGitter> <marksiemers> @aroaminggeek - Also, if you haven't seen it, there is a recent post from Manas: https://crystal-lang.org/2017/12/19/this-is-not-a-new-years-resolution.html (I know it has been posted here already, but may be buried at this point)
codenoid has quit [Ping timeout: 256 seconds]
<RX14> openssl is broke on mac
<FromGitter> <fridgerator> ^
<RX14> and nobody seems to know wh
<RX14> y
<FromGitter> <fridgerator> its using the system openssl, which is outdated
<FromGitter> <paulcsmith> @fridgerator Yep! High Sierra
<FromGitter> <fridgerator> a newer version can be installed through brew, but crystal doesn't use it
<FromGitter> <paulcsmith> It's also happening on Heroku though :S
<crystal-gh> [crystal] RX14 closed pull request #5425: Fix a tiny typo in comment (master...fix/crystal/type-in-comment) https://git.io/vbyDg
<FromGitter> <fridgerator> @paulcsmith I had similar issues with the Stripe API on mac, I had to switch to using linux since the Open SSL version was correct
<FromGitter> <paulcsmith> But even working locally wuold be awesome. Do you remember what you did to get it working?
<FromGitter> <fridgerator> yeah, use docker ;)
<FromGitter> <fridgerator> but strange that its happening to you on heroku
<FromGitter> <aroaminggeek> Yup I saw that. Kudos to all for their transparency as well. The updates convinced me to continue checking it out and taking a stab at it 🙂
<FromGitter> <paulcsmith> Yeah I'd rather not use Docker on Heroku just to fix this haha
<FromGitter> <paulcsmith> And I can connect to Google in other languages so I assume there is a way to get it working on Crystal. I just can't figur eit ous :S
<FromGitter> <fridgerator> well I meant use docker locally, if its not working in another linux environment then its a different issue than I saw
<crystal-gh> [crystal] woodruffw opened pull request #5441: INI: Implement type coercion for `parse` (master...ini-parse-coerce) https://git.io/vbHZT
<FromGitter> <paulcsmith> Oh I see. Yeah bummer. I'll keep trying stuff out
<FromGitter> <fridgerator> I know you can add options to the ssl client to force using specific versions : https://crystal-lang.org/api/0.23.1/OpenSSL/SSL/Context.html#add_options%28options%3AOpenSSL%3A%3ASSL%3A%3AOptions%29-instance-method
<FromGitter> <mvlootman> Should the following code not result in an exact file copy? ⏎ src = File.open("./test.dat") ⏎ dest = File.open("./output.dat", "w") ⏎ IO.copy src, dest [https://gitter.im/crystal-lang/crystal?at=5a3d60a8b48e8c35665755df]
<FromGitter> <mvlootman> I am ending up short in bytes in the dest file
<FromGitter> <paulcsmith> Thanks @fridgerator! Trying some of those options now. Still no lucky but hoping to find something soon :)
<FromGitter> <bew> Can you try `dest.flush` before the end (or before closing the files)
<RX14> @mvlootman you should use the block form of `File.open` for this reason
<RX14> @mvlootman https://carc.in/#/r/3a4d
<RX14> this will work
<RX14> it's that File is buffered so if you don't call .close then you will loose bytes that haven't been flushed from the buffer
<RX14> as well as having a file descriptor leak
<FromGitter> <mvlootman> ok thanks, the dest.flush worked, but the block format is the better approach
<RX14> the block format ensures that `.close` (which calls `flush`) is called
<RX14> even if you get an exception
<FromGitter> <mvlootman> ah great
<FromGitter> <mvlootman> before I named my block variable out (instead of dest)
<FromGitter> <mvlootman> that (out) was a keyword?
<RX14> yes
<RX14> it's used for C bindings
<RX14> where variables can be "out" variables
<RX14> i.e. you get a variable out of the argument by passing a pointer in
<FromGitter> <mvlootman> ah I see
<FromGitter> <mvlootman> i thought it couldn't copy because it was inside a nested block
<FromGitter> <mvlootman> thanks for the help!
<travis-ci> crystal-lang/crystal#e04565f (master - Fix a tiny typo (#5425)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/320358867
DTZUZU has quit [Quit: WeeChat 1.9]
<FromGitter> <jwaldrip> I have employees that work for me in Argentina, I've decided to have them show up at the manas office if we don't get a release soon.
DTZUZU has joined #crystal-lang
<Yxhuvud> hopefully to help them?
<FromGitter> <jwaldrip> Whatever it takes
<FromGitter> <jwaldrip> Bring them cookies
<FromGitter> <jwaldrip> lunch, i don't care.
<FromGitter> <jwaldrip> Ive only got one in Buenos aires, the rest are in Bahia Blanca
<FromGitter> <jwaldrip> Its a couple hours worth of driving... but 0.24.1 may be worth it.
<FromGitter> <jwaldrip> Doing anything malicious would be counter productive. I just want to help them... somehow.
aroaminggeek has joined #crystal-lang
<RX14> @jwaldrip there's been a breakthrough
<RX14> it's coming
<FromGitter> <bararchy> Nice :)
<FromGitter> <jwaldrip> YAY!
<FromGitter> <jwaldrip> A Wonderful Christmas Present this will be!
aroaminggeek has left #crystal-lang ["Textual IRC Client: www.textualapp.com"]
<FromGitter> <jwaldrip> RX14, where is the Dockerfile that is going to be used in future releases?
<FromGitter> <jwaldrip> or is it the same one that is in master now.
<FromGitter> <jwaldrip> Should the main Dockerfile within the crystal package be removed then?
<oprypin> > readme
<oprypin> also they probably have different purposes
hightower2 has joined #crystal-lang
<FromGitter> <jwaldrip> Well, I certainly cant get masters dockerfile built
ylluminate has joined #crystal-lang
<FromGitter> <jwaldrip> So if that is broken, I would like to know why...
<FromGitter> <jwaldrip> Does crystal 0.24.1 depend on LLVM 4?
<oprypin> depends on some version of llvm
<oprypin> likely 3.8+ but it's hard to check
<FromGitter> <jwaldrip> Okay, well I will just have to be patient and wait for the release until I can release my docker based app...
<FromGitter> <jwaldrip> Unless anyone has a 0.24.1 docker build going on
hightower2 has quit [Changing host]
hightower2 has joined #crystal-lang
<RX14> yes they have different purposes oprypin
<RX14> that's a distribution packaging script that happens to run in docker
<RX14> I think @jwaldrip actually wants a docker image itself
<FromGitter> <jwaldrip> yes... right now hub.docker.com, just has 0.23.1
<crystal-gh> [crystal] woodruffw closed pull request #5441: INI: Implement type coercion for `parse` (master...ini-parse-coerce) https://git.io/vbHZT
<FromGitter> <jwaldrip> The employee I told you about lives very close to manas
<FromGitter> <jwaldrip> like 50 meters
<FromGitter> <jwaldrip> he may run over some cookies :-)
<FromGitter> <jwaldrip> or a bottle of wine
<wmoxam> Is there anything in particular holding up the 0.24.1 release? It's been tagged and all ...
<RX14> generating the packages
<wmoxam> Is the code that generates packages available?
<wmoxam> I'm just curious, I've got the OpenBSD port updated already
<wmoxam> but for future releases I'd like the object file that it depends on to be available from an *official* source
<RX14> yes it is wmoxam
<RX14> the new code that's first being used for this release is here: https://github.com/crystal-lang/distribution-scripts
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<wmoxam> 🏻
<wmoxam> :/
<wmoxam> thanks RX14
<RX14> np wmoxam
<FromGitter> <jwaldrip> Did we still have a breakthrough?
<RX14> yes
happycoder has joined #crystal-lang
happycoder has quit [Ping timeout: 240 seconds]