RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.0 | 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
<FromGitter> <Blacksmoke16> ill make an issue
jokke has quit [Quit: WeeChat 2.3]
jokke has joined #crystal-lang
jokke1 has joined #crystal-lang
jokke has quit [Ping timeout: 246 seconds]
jokke1 is now known as jokke
<FromGitter> <theretromaniac> It is my idea or the activity here in the channel stuck?
<FromGitter> <Blacksmoke16> depends on tz
<FromGitter> <Blacksmoke16> most euros are sleeping now
<FromGitter> <theretromaniac> no i dont mean that
<FromGitter> <theretromaniac> i mean the github bridge
<FromGitter> <theretromaniac> last activity i see is jan 07
<FromGitter> <Blacksmoke16> ohh
<FromGitter> <theretromaniac> do you see the same or is my problem?
<FromGitter> <Blacksmoke16> oh, tbh i never noticed that :3
<FromGitter> <theretromaniac> 😆
<FromGitter> <theretromaniac> how Athena is going?
<FromGitter> <theretromaniac> i eventually starting my prototype
<FromGitter> <Blacksmoke16> currently working on next big feature
<FromGitter> <Blacksmoke16> at this point mostly just waiting on feedback/bugs for the core portion of it
<FromGitter> <Blacksmoke16> just need ppl to start using it
<FromGitter> <theretromaniac> 👍
<FromGitter> <Blacksmoke16> omg
<FromGitter> <Blacksmoke16> spent like 45min trying to figure out why this wasnt working
<FromGitter> <Blacksmoke16> `class_property = command_name : String = "dsfdsf"`
jokke has quit [Quit: WeeChat 2.3]
jokke has joined #crystal-lang
Renich_ has joined #crystal-lang
Renich has quit [Ping timeout: 272 seconds]
Renich_ is now known as Renich
sagax has quit [Quit: Konversation terminated!]
Renich_ has joined #crystal-lang
Renich has quit [Ping timeout: 246 seconds]
Renich_ is now known as Renich
laaron- has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
Dreamer3_ has joined #crystal-lang
<FromGitter> <drujensen> lol
moei has joined #crystal-lang
<FromGitter> <girng> lol
<FromGitter> <Blacksmoke16> check this out
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c36b968317e2407cd098d8b]
<FromGitter> <Blacksmoke16> working on implementing CLI commands into athena
<FromGitter> <Blacksmoke16> idea is you can make them to arbitrary things, like migrations of data, or adding x role to y user etc
<FromGitter> <Blacksmoke16> so like you define a command like that
<FromGitter> <Blacksmoke16> call `Athena.register_commands` in your main cr file
<FromGitter> <Blacksmoke16> then when you build it you can do like `
<FromGitter> <Blacksmoke16> `./myApp -c user --id=1 --name=Bob`
<FromGitter> <Blacksmoke16> still WIP, but thats the general idea
<FromGitter> <Blacksmoke16> main benefits are: allows it to still be a part of the app, access to same db connections etc, testable, easily document it, and have them optionally included in your binary for use on your server, vs maintaining a bunch of single binaries or your own option parser
<FromGitter> <drujensen> Looks familiar. 😉
DTZUZO has quit [Ping timeout: 252 seconds]
marmotini_ has joined #crystal-lang
DTZUZO has joined #crystal-lang
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <rishavs> Quick question, whats the maximum size of a string in Crystal (in Mb/Gb)?
DTZUZO has quit [Ping timeout: 245 seconds]
<FromGitter> <sam0x17> Is there a way to place type constraints on a generic class parameter?
<FromGitter> <sam0x17> I was hoping it would be like `class Something(T : SomethingElse) ...`
<FromGitter> <sam0x17> edit: I want T to extend SomethingElse
<FromGitter> <sam0x17> so I'm looking for something like `class Something(T extends SomethingElse)...`
<FromGitter> <bararchy> Thanks oprypin :)
<FromGitter> <DanilaFe> Wouldn't the idiomatic approach here be just duck typing, @sam0x17?
spacemanspam has quit [Read error: Connection reset by peer]
Renich has quit [Quit: Renich]
<FromGitter> <j8r> @Blacksmoke16 `Commands::Command`?
<FromGitter> <j8r> IMO `Commands::Cli` or CLI is clearer :)
<FromGitter> <j8r> @sam0x17 for your comment on crystal init, the main point isn't deleted it
<FromGitter> <j8r> it is to move it out from crystal-lang/crystal
<FromGitter> <j8r> `crystal init` could still exist, but internally a git submodule/subtree /vendoring/shard would be used
<FromGitter> <j8r> this way you have other maintainers than only the core team
<FromGitter> <j8r> *you could have
<FromGitter> <greenbigfrog> I'm currently wondering whether I should port
<FromGitter> <bararchy> @greenbigfrog port what?
<FromGitter> <greenbigfrog> https://github.com/citizen428/bitcoin_rpc/blob/master/src/bitcoin_rpc.cr to be a module so that once can simply do BitcoinRpc.
<FromGitter> <greenbigfrog> Wtf gitter on Android. Please stop sending my messages
<FromGitter> <greenbigfrog> One sec
<FromGitter> <vladfaust> I've set up buildkite.com -- it's CI on your own infrastructure. Marvelous design, absolutely free. Would recommend. Works nicely with Crystal and docker plugin: https://gist.github.com/vladfaust/b70a671075c1e7ce1dc854265db0329e.
<FromGitter> <greenbigfrog> *so that one can simply do BitcoinRpc.getinfo etc isntead of having them as class methods(?), so that one can configure like
<FromGitter> <greenbigfrog> Why do my messages keep simply sending if I return from a other app
<FromGitter> <greenbigfrog> *kemal does
<FromGitter> <greenbigfrog> Or is there a simpler/better way I could/should handle this? I'm thinking about making it like this since there's no state storing either way
<FromGitter> <j8r> @greenbigfrog i noticed when we switch to another app/tab, the message in-writing is sent
<FromGitter> <j8r> when we go back to the window
<FromGitter> <j8r> and sometimes, the previous message in autocompleted, even if already sent :/
<FromGitter> <j8r> gitter on android sucks :(
<FromGitter> <staleo> @j8r what a coincidence: just like the gitter itself lol
<FromGitter> <j8r> there is no perfect solution, each one bring its drawbacks
<FromGitter> <j8r> there are great IRC Android clients I could use
<FromGitter> <tonobo> > @tonobo can you share the code of the app you're testing with? Maybe just an issue with resources not being freed ⏎ @bararchy ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c37160fa57b501bcfdffd24]
<FromGitter> <bararchy> Oh, ok
<FromGitter> <tonobo> I've tried rust, this performes quite well. But it's not fair to compare crystal and rust ;)
ashirase has quit [Ping timeout: 250 seconds]
ashirase has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <tonobo> It might be related to: `accept: Too many open files (Errno)`
blassin has quit [Remote host closed the connection]
blassin has joined #crystal-lang
<FromGitter> <greenbigfrog> Any thoughts on my question?
<FromGitter> <bararchy> if there is not state storing you can do that, or, just add `def self.my_method` which means it can be accessed without initialization
<FromGitter> <bararchy> @j8r , I wanted to PR a way to allow setting certificate path without needing a file (Certificate.new basiclly), but I get an error, you think you can give me your idea on it ?
devil_tux has joined #crystal-lang
<devil_tux> morning all :> is there repository for playground? I think I found a bug
emilsp has left #crystal-lang ["WeeChat 2.1"]
<FromGitter> <theretromaniac> github activity stuck
<FromGitter> <bararchy> yeha
<FromGitter> <j8r> @bararchy are you talking about the OpenSSL module, which us LibSSL?
<FromGitter> <j8r> they have done a production release yesterday, for profile status
<FromGitter> <j8r> I noticed also the tags are shown differently in the repos: https://github.com/crystal-lang/crystal/ref-list/master?source_action=disambiguate&source_controller=files is embeded
<FromGitter> <j8r> I parse the page to get all tags to avoid using the API
<FromGitter> <greenbigfrog> @bararchy well, there's no state storing, but configuration
<FromGitter> <bararchy> @tonobo "Too many open files" the silent killer of Linux performance testing ;) time to `ulimit` it up
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <j8r> @bararchy it can't work, cert is a Crystal object.
<FromGitter> <j8r> LibC doesn't know crystal
<FromGitter> <bararchy> when you pass a Crystal object to the bindings it will always call `to_unsafe` so this is done automaticlly
<FromGitter> <j8r> oh ok
<FromGitter> <j8r> so that's not this
<FromGitter> <j8r> so remains the bindings, I guess
<FromGitter> <j8r> the function is not called properly, or not the right function
<FromGitter> <bararchy> ` int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);`
<FromGitter> <j8r> don't know then
<FromGitter> <bararchy> I hate OpenSSL :(
<FromGitter> <bararchy> it's like arcane magic, half of the API is C macros
<FromGitter> <yxhuvud> Yes, and the error messages are ungoogle-able
<FromGitter> <bararchy> ^ exactly
<FromGitter> <Blacksmoke16> @j8r prob not a bad idea
bmcginty has quit [Ping timeout: 272 seconds]
<FromGitter> <Blacksmoke16> @drujensen familiar to what? ;)
marmotini_ has quit [Remote host closed the connection]
bmcginty has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter> <j8r> what's the best way to generate a secure password in Crystal?
<FromGitter> <j8r> `Random::Secure`, and then?
<FromGitter> <fridgerator> `Crypto::Bcyrpt`
<FromGitter> <j8r> @fridgerator not encrypting, generating :)
<FromGitter> <fridgerator> `Crypto::Bcrypt::Password`
<FromGitter> <fridgerator> oh
<FromGitter> <j8r> in clear
<FromGitter> <j8r> (because nearly all applications wants a database password in clear in their conf)
<FromGitter> <fridgerator> `Random.urlsafe_base64` ?
<FromGitter> <drum445> @j8r a uuid?
<FromGitter> <j8r> I could use `require "uuid"; puts UUID.random.to_s.split("-").last`, wondering if there is a cleaner way
<FromGitter> <drum445> why have it so short?
<FromGitter> <drum445> if you don't want dashes just remove all of them, but keep the entire string
<FromGitter> <j8r> I don't want and UUID, with dashes
<FromGitter> <j8r> I'msure there is a better way
<FromGitter> <fridgerator> if you dont want the dashes, then why use uuid, lol
<FromGitter> <j8r> yes, I don't want to
<FromGitter> <j8r> ideally
<FromGitter> <drum445> oh fair enough, maybe: SecureRandom.hex
<FromGitter> <fridgerator> I usually use `urlsafe_base64`
<FromGitter> <fridgerator> but I guess thats not secure
<FromGitter> <drum445> imo
<FromGitter> <j8r> I don't see this methods in https://crystal-lang.org/api/master/Random/Secure.html
<FromGitter> <j8r> @drum445 thanks `Random::Secure.hex` is perfect :)
<FromGitter> <Blacksmoke16> its extended from https://crystal-lang.org/api/master/Random.html#hex%28n%3AInt%3D16%29%3AString-instance-method
<FromGitter> <Blacksmoke16> the secure just changes the random algorithm afaik
<FromGitter> <Blacksmoke16> i.e. `Random::Secure` has all methods that `Random` does but in a more "secure" manner
<FromGitter> <j8r> @drum445 hum not perfect in fact there is no caps
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/5ytf
<FromGitter> <j8r> to sumup: I would like 12-16 chars that can be ASCII letters, downcase and upcase. Eventually, special chars
<FromGitter> <Blacksmoke16> how about that?
<FromGitter> <Blacksmoke16> and just chomp last `=`
<FromGitter> <Blacksmoke16> can change the number to get how many bytes you want it to be
<FromGitter> <j8r> perfect https://play.crystal-lang.org/#/r/5yth
<FromGitter> <Blacksmoke16> be mindful they might have `/` in them
<FromGitter> <j8r> :/
<FromGitter> <Blacksmoke16> darn
<FromGitter> <j8r> That's not cool
<FromGitter> <j8r> Because I use is too create a directory
<FromGitter> <j8r> *the same function
<FromGitter> <j8r> ok I'll use `puts Random::Secure.urlsafe_base64` for passwords
<FromGitter> <j8r> thx @fridgerator
<FromGitter> <j8r> and `Random::Secure.hex(8)` for system stuf like directory, posix users etc
<FromGitter> <j8r> I hope MySQL and PostgreSQL will likes `Random::Secure.urlsafe_base64`
<FromGitter> <Blacksmoke16> assuming you're just storing it in a text column it shouldnt really matter
<FromGitter> <talbergs> Hello crystallers. ⏎ ⏎ 1) How can I listen to mouse events using Crt? https://github.com/maiha/crt.cr ⏎ 2) another question I have is: How can I resize Crt::Window instance (Now I have to recreate that instance, but I would like to resize that "canva grid" of an existing one). [https://gitter.im/crystal-lang/crystal?at=5c375bfe66f3433023a6b645]
<FromGitter> <talbergs> @maiha @maiha_twitter
spacemanspam has joined #crystal-lang
spacemanspam has quit [Read error: Connection reset by peer]
<FromGitter> <girng> good morning!
<FromGitter> <j8r> good night!
<FromGitter> <j8r> Or good evening from UTC
<FromGitter> <theretromaniac> Good evening
<FromGitter> <theretromaniac> 19:04 Here
<FromGitter> <theretromaniac> 😆
<FromGitter> <j8r> my dream it the whole world to be in UTC
<FromGitter> <j8r> no more hassle
<FromGitter> <j8r> already there a some place where it's night at 15:00
<FromGitter> <theretromaniac> we should abandon the world and move in one medirian
<FromGitter> <girng> everything should use crystal
<FromGitter> <girng> would be nice
patrickmcnamara has joined #crystal-lang
<FromGitter> <bew> 😂
<FromGitter> <girng> i'm about to rage. vscode is the most buggiest editor i've ever used in my life. so, remember 3 weeks ago or so i said it doesn't save my tabs (mostly crystal files). straight-shoota said there was an option for this, and he was right. the setting is "restore windows". i have it set to *all*. however, i just restarted my computer and opened vscode, and guess what all my crystal file tabs and everything is gone.
<FromGitter> ... so now, i have to re-open all my 6~ crystal files, my json file and then drag the tabs around. ⏎ ⏎ there was also an issue with the bookmarks plugin when using crystal's vscode formatter. however, it wasn't an issue with the @faustinoaq's addon, it was an issue with the editor itself, see this (https://github.com/alefragn ... [https://gitter.im/crystal-lang/crystal?at=5c37869083c7e377654ac407]
<patrickmcnamara> How do I get a hexadecimal string of a UInt64?
<Yxhuvud> to_s(16)
<patrickmcnamara> Perfect. Thanks. 😊
<FromGitter> <fridgerator> @girng i've never had any of these issues with vscode
<FromGitter> <fridgerator> thats strange
Raimondi has joined #crystal-lang
Simerax has joined #crystal-lang
<Simerax> hello guys i just started out using Crystal. Is there an equivalent to the base keyword of C#? If I have a Class "person" with the method "say_name" and then i have a subclass "employee" which inherits from "person" and i override the "say_name" method inside "employee" how can i then call the "say_name" method from "person"? The "prevous_def" function doesn't seem to do that
<FromGitter> <Blacksmoke16> try `super`
<Simerax> thanks a lot! that did the trick
<FromGitter> <Blacksmoke16> 👍
<Simerax> should have read through the complete document ^^ my bad
<devil_tux> can someone jump in on how to logicaly achieve this: https://play.crystal-lang.org/#/r/5yv5
<devil_tux> i know there is a way through handlers, still wondering on current case
spacemanspam has joined #crystal-lang
<FromGitter> <Blacksmoke16> whats the ultimate goal?
<devil_tux> @Blacksmoke16: eh, lets say reusing method as a context
<FromGitter> <Blacksmoke16> well you could use a macro to do things to the context
<FromGitter> <Blacksmoke16> like
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c379a906a394e2821893579]
<FromGitter> <Blacksmoke16> which is useful for errors, kemal has https://github.com/kemalcr/kemal/blob/master/src/kemal/helpers/macros.cr#L80
<devil_tux> @Blacksmoke16: bless, thats exactly what I was trying to do
<FromGitter> <Blacksmoke16> 👍
<devil_tux> ty <3
<FromGitter> <girng> @fridgerator i've made an issue on vscode repo finally
<FromGitter> <drum445> @girng yeah VS code has a few issues that just made it more frustrating than it should be; I'm back with the trusty Sublime now
<FromGitter> <girng> yeah, i was using sublime with crystal's formatter plugin. worked great, until randomly on save, it would delete half of your code
<FromGitter> <drum445> not sure what's going on there, been using it for years and never seen anything like that
<FromGitter> <girng> do you use the crystal plugin with it?
<FromGitter> <drum445> I do
<FromGitter> <j11m> I am attempting to implement a C Callback with a closure, as documented at the bottom of: https://crystal-lang.org/reference/syntax_and_semantics/c_bindings/callbacks.html. I intend to send the data from the callback to a channel, and this fails with: `BUG: Thread.current returned NULL`. `Channel.send` attempts to get the `current_fiber`, which in turn calls `Thread.current` -- but a C Callback cannot access its
<FromGitter> ... current thread inside of Crystal. Is there any way to make its `Thread.current` known?
<FromGitter> <j8r> @fridgerator @girng is on Windows, it may be that 😁
<FromGitter> <girng> 😆
spacemanspam has quit [Read error: Connection reset by peer]
Dreamer3_ has quit [Quit: Leaving...]
patrickmcnamara has quit [Quit: Page closed]
laaron- has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
Raimondi has quit [Ping timeout: 240 seconds]
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
Simerax has quit [Remote host closed the connection]
<FromGitter> <sam0x17> @j8r that makes sense -- didnt realize that
<FromGitter> <malkomalko> just finishing up Programming Crystal (Beta 3), and it's been a really good quick read to get me caught up to speed
<FromGitter> <j11m> To follow up from my message earlier, it would appear that a C-Callback in Crystal gives no access to Fibers. As a result, a C-Callback cannot do logging, write to channels, spawn, etc from within a C-Callback. This seems like a serious limitation. Has anyone found a workaround for this?
Raimondi has joined #crystal-lang