<FromGitter>
<faustinoaq> I have a question, ECR templates are inlined and embedded to binary executable when a project is compiled, so Would this approach be faster that reading file system each time like all common web frameworks do?
<FromGitter>
<bew> yeah totally
<FromGitter>
<bew> the templating file is read & parsed at compile time, where other templating needs to do this at runtime (they'll probably read & parse only once, and keep the parsed template somewhere in memory)
<FromGitter>
<georgeu2000> It is an array of Int32.
<FromGitter>
<georgeu2000> I get `Can't infer the type of instance variable '@abundants' of Calculator`.
<FromGitter>
<bew> you need to declare it as `@abundants : Array(Int32)`
<FromGitter>
<georgeu2000> `instance variable '@abundants' of Foo was not initialized in all of the 'initialize' methods, rendering it nilable`, so it seems I need to initialize it in the `initialize` method...
<FromGitter>
<bew> depends on what you need, if it can be nil, you can declare it as an `Array(Int32)?` (note the `?`, making it nilable), or you can init it in `initialize` either with a default value (empty array?) or with your code
rohitpaulk has joined #crystal-lang
<FromGitter>
<georgeu2000> Oh, I see. Thanks.
greengriminal has joined #crystal-lang
weston1 has quit [Ping timeout: 252 seconds]
vegai has quit [Remote host closed the connection]
<crystal-gh>
[crystal] asterite opened pull request #5017: Remember STDIN, STDOUT and STDERR blocking state when program begins and restore it at the end (master...bug/2713-fix-blocking) https://git.io/vdvMu
rohitpaulk has quit [Ping timeout: 260 seconds]
<crystal-gh>
[crystal] Sija opened pull request #5018: Use `TypeNode#union_types` where possible (master...pr-4995-followup) https://git.io/vdvMj
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
bmcginty has quit [Ping timeout: 240 seconds]
thitch has joined #crystal-lang
bmcginty has joined #crystal-lang
thitch has quit [Quit: Page closed]
rohitpaulk has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
thews has quit [Ping timeout: 240 seconds]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
thews has joined #crystal-lang
thews has quit [Changing host]
thews has joined #crystal-lang
<FromGitter>
<ansarizafar> I have initiated a class defined in a module. How can access its methods
<FromGitter>
<bew> you can access those method like any other methods in any classes
<FromGitter>
<bew> as in `my_log = WebWare::Log.new; my_log.logme("msg", color)`
rohitpaulk has quit [Ping timeout: 252 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter>
<ansarizafar> I have read guide/api documentation. I have initiated the calls like this WebWare::Log.new without assigning it to a variable as mentioned in the guide https://crystal-lang.org/docs/syntax_and_semantics/modules.html my question is how can I access methods from a different file
<FromGitter>
<bew> you just need the module in a separate file, not the last line. In another file, require the file with the module (see https://crystal-lang.org/docs/syntax_and_semantics/requiring_files.html), then you can instantiate your class (save the instance to a variable) and use it's methods.
<FromGitter>
<ansarizafar> Another related question is how can I create singleton object . I don't want to initiate Log class in every file.
<FromGitter>
<bew> 2 ways (maybe more): with a constant (intialized before everything), with a class method (initialized on first demand). example: https://carc.in/#/r/2rv5
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter>
<ansarizafar> class variable did the job me.
<FromGitter>
<krypton97> apple, google and microsoft on first 3 places, what a surprise :) ..Sometimes I wonder how popular these languages would be without google's/ apple's back
claudiuinberlin has joined #crystal-lang
<FromGitter>
<krypton97> nice scala stairs
claudiuinberlin has quit [Client Quit]
_whitelogger has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
early has quit [Quit: Leaving]
early has joined #crystal-lang
lapinferoce has joined #crystal-lang
flaviodesousa has joined #crystal-lang
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 246 seconds]
bmcginty has quit [Ping timeout: 248 seconds]
bmcginty has joined #crystal-lang
<Groogy>
when a macro for logging accidentally allocates memory for strings and it just kills our performance and it took way too long to find that out <_<
<FromGitter>
<ziprandom> hey @sdogruyol is there a way to have kemal auto re[compile/start] while developing?
<FromGitter>
<ziprandom> @krypton97 tried it, it doesn't work. can't compile in release mode. in dev mode the binary does nothing. not even shoe `--help` output :/
<FromGitter>
<jose-rodrigues> @ziprandom What do you mean by `the binary does nothing` even whenm you compile directly with crystal?
lapinferoce has quit [Ping timeout: 255 seconds]
<FromGitter>
<ansarizafar> Beginner Question: Is there any global exception handler in Crystal?
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzzβ¦]
claudiuinberlin has joined #crystal-lang
<Yxhuvud>
not be default, but you can always wrap whatever you are writing with begin .. rescue .. end. I'd advise strongly to not do that though.
<FromGitter>
<zyriuse75> @krypton97 thank for the link man π
<ShalokShalom>
Papierkorb: You said your bindings are ready for Tier 1 KDE?
<FromGitter>
<krypton97> np m8 ;)
<FromGitter>
<krypton97> @ziprandom try to submit an issue, haven't used it so far
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
ShalokShalom_ has joined #crystal-lang
ShalokShalom has quit [Ping timeout: 252 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzzβ¦]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzzβ¦]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
<FromGitter>
<imonmyown> Hi all :)
<FromGitter>
<imonmyown> What are the generally accepted marshalling tools, or if none are available what is the preferred way to store application settings locally?
mark_66 has quit [Remote host closed the connection]
<gcds>
Maybe someone could help me. I am trying to compile std lib and get problem I think on mac somehow std lib cant find libcrypto. Maybe someone has encountered this problem? pkg-config libcrypto doesnt return nothing...
<gcds>
it does return sorry but still I cant build :(
snsei has joined #crystal-lang
<gcds>
i think I know the problem my openssl is to old
<gcds>
too*
<FromGitter>
<Sly777> Hey all, I'm trying to make crystal app with Kemal, Granite ORM on postgres. My question is I created one model that needs to update password to encrypted one. But on the build, It's giving error as *instance variable '@password' of User must be (String | Nil), not Crypto::Bcrypt::Password* β β ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59c52907bac826f054ea517d]
<FromGitter>
<fridgerator> `.to_s`
sstory has joined #crystal-lang
<crystal-gh>
[crystal] aurimasniekis opened pull request #5021: Added `pkcs5_pbkdf2_hmac` to `lib_crypto.cr` and `pkcs5.cr` (master...feature/opensll_pbkdf2_implementation) https://git.io/vdfyl
<FromGitter>
<Sly777> But after that, How can I cast to Bcrypt again to compare password?
<FromGitter>
<Sly777> Btw. I'm really new on crystal so It can be dumb question :D
<gcds>
yay... the same error I had on my machine is now on CircleCI :D
<FromGitter>
<luislavena> @gcds CircleCI for OSX? Same solution you applied locally you might want to apply to CI, might recommend install newer OpenSSL using Homebrew.
<gcds>
luislavena, Locally I just used PKG_CONFIG_PATH flags to help find brew version of openssl so it worked out, but I have no idea how to fix circleci build.
<gcds>
ahhh its osx build
<gcds>
now I got it :D
<gcds>
hmm it did not worked like I expected trying something out :(
<gcds>
I am feeling bit like idiot... the original `PKCS5_PBKDF2_HMAC_SHA1` is found but additional `PKCS5_PBKDF2_HMAC` method is not found then its in the same lib. Even then in OpenSSL `PKCS5_PBKDF2_HMAC_SHA1` wraps a call `PKCS5_PBKDF2_HMAC`
<FromGitter>
<sdogruyol> @krypton97 that's some big effort :)
<FromGitter>
<jwaldrip> with self yeild does not seem to be working
<FromGitter>
<bew> can you be *a bit* more precise?
<FromGitter>
<jwaldrip> hold on, putting together an example
<FromGitter>
<jwaldrip> actually, just self does not work
<FromGitter>
<jwaldrip> in the block
<FromGitter>
<jwaldrip> nvm :-)
<FromGitter>
<krypton97> Well, it's unix based and a good part of the code is copy pasted . I guess not so many devs wanna mess with win api
<FromGitter>
<sdogruyol> It's not that but more likely there arent much devs who knows much about win32 stuff @krypton97
<FromGitter>
<krypton97> Ikr. There's also musl which seems to do better than the gnu implementation https://www.musl-libc.org/
<FromGitter>
<krypton97> unix based again :)
<FromGitter>
<sdogruyol> I
astronavt has quit [Remote host closed the connection]
<RX14>
i am so confused by what i've done to the compiler
<crystal-gh>
[crystal] asterite opened pull request #5022: Increase the precision of Time and Time::Span to nanoseconds (master...feature/time) https://git.io/vdJCp
<FromGitter>
<papilip> Hello All, Do you know who is responsible for the Crystal logo and its reuse ?
<FromGitter>
<faustinoaq> compiled to binary, of course π
snsei has quit [Remote host closed the connection]
<RX14>
you execute that after every command?
<FromGitter>
<faustinoaq> yes π
<FromGitter>
<krypton97> I'm just wondering, couldn't crystal borrow some code from go when it comes to adding win support?
<crystal-gh>
[crystal] ysbaddaden closed pull request #5022: Increase the precision of Time and Time::Span to nanoseconds (master...feature/time) https://git.io/vdJCp
<RX14>
@krypton97 no
<FromGitter>
<krypton97> Well, was expected
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
_whitelogger has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter>
<faustinoaq> Crystal began to grow at mid 2014, so aprox. 3 yrs. ago. This confirm me that Crystal is relatively new language. However We have achieved a lot so far. β β If we think to be stable in 1 year, then Crystal will be a language with aprox. 7 years in construction.
<FromGitter>
<faustinoaq> Just take JavaScript, 7 days + 1 man = ready for production! (Netscape: what would be wrong, no?)