ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.30.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
<FromGitter> <Daniel-Worrall> That's how it is in the docs and that's how I do it
<FromGitter> <Daniel-Worrall> Awaiting a river's processing
<FromGitter> <Blacksmoke16> Works for me
<FromGitter> <Daniel-Worrall> Fiber*
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <Brandongoodman615> is there an active Crystal slack channel?
<FromGitter> <Blacksmoke16> No, this is your best bet
<FromGitter> <Brandongoodman615> cool
<FromGitter> <Brandongoodman615> I'm trying to figure out a code challenge on codewars and it's surprisingly difficult for me
<FromGitter> <Brandongoodman615> Ruby is pretty much the only language i'm very familiar with.
<FromGitter> <Brandongoodman615> I know that .sum works on an array, but when I convert the strings to int it doesn't let me sum the array of ints. throws overload errors I can't figure out.
<FromGitter> <Blacksmoke16> `["1", 2, "5"].sum { |val| val.is_a?(String) ? val.to_i : val }`
<FromGitter> <Brandongoodman615> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8584af28c1df0ed66a0365]
<FromGitter> <Blacksmoke16> description is wrong,`Given an array of integers as strings and numbers`
<FromGitter> <Blacksmoke16> should say `chars` not strings
<FromGitter> <Blacksmoke16> same idea tho, just use `is_a?(Char)` instead
<FromGitter> <Blacksmoke16> `['1', 2, '5'].sum { |val| Int32.new val }`
<FromGitter> <Blacksmoke16> event simpler
<FromGitter> <Blacksmoke16> even*
<FromGitter> <Brandongoodman615> wow, that was way easier than what I was trying
<FromGitter> <Blacksmoke16> `pp ['1', 2, '5'].sum &->Int32.new(Int32 | Char)`
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Int32.html#new!(value)-class-method
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Int32.html#new(value)-class-method
<FromGitter> <Blacksmoke16> 2nd one sorry
<FromGitter> <Brandongoodman615> how can I post multi line code in here?
<FromGitter> <Brandongoodman615> 3 backtics didn't work for me
<FromGitter> <Blacksmoke16> three backticks, newline, code, newline, three backticks
<FromGitter> <Brandongoodman615> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8585e88521b34d916298cf]
<FromGitter> <Brandongoodman615> nice
<FromGitter> <Brandongoodman615> ok, so why wouldn't this work?
<FromGitter> <Blacksmoke16> `if i.class == CHar` isnt a proper way to restrict by type
<FromGitter> <Blacksmoke16> would want to do `if i.is_a? Char`
<FromGitter> <Brandongoodman615> well, holy shit
<FromGitter> <Brandongoodman615> I spent way too long on this.
<FromGitter> <Blacksmoke16> indeed :p
<FromGitter> <Brandongoodman615> Thanks man!
<FromGitter> <Blacksmoke16> np
<FromGitter> <Brandongoodman615> I'm not yet to a year of Ruby development, and I love playing with Crystal because I feel like it still helps me get better with Ruby
<FromGitter> <Blacksmoke16> i could believe it
<FromGitter> <Blacksmoke16> kinda forces some better practices on you
<FromGitter> <Brandongoodman615> exactly!
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Enumerable.html#sum(&block)-instance-method is the reference on the `#sum(&block)` method i was using
<FromGitter> <Brandongoodman615> I will! the struggle is real. I have to understand docs instead of stack overflow spoon feeding me ruby lol
<FromGitter> <Blacksmoke16> yea the api docs + the git book are the places id start
<FromGitter> <Blacksmoke16> always room for doc PRs as well πŸ˜‰
<FromGitter> <Brandongoodman615> I'm not even sure I know how to do that. I've never done any type of open source contributing, but that's kinda why I'm here.
<FromGitter> <Blacksmoke16> tl;dr fork the repo, make a branch, do your changes, push it up, make a pr
f1refly has quit [Ping timeout: 252 seconds]
f1refly has joined #crystal-lang
<FromGitter> <Brandongoodman615> I still can't get this to pass the final test
<FromGitter> <Blacksmoke16> oh?
<FromGitter> <Brandongoodman615> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d858d5e2438b53a64ebfa76]
<FromGitter> <Blacksmoke16> whats your code?
<FromGitter> <Brandongoodman615> That's what I was getting with the sample tests
<FromGitter> <Brandongoodman615> what you gave me
<FromGitter> <Brandongoodman615> `x.sum {|e| e.is_a?(Char) ? e.to_i : e}`
<FromGitter> <Brandongoodman615> I tried it my way with is_a? and it failed, so I tried yours
<FromGitter> <Brandongoodman615> mine did start passing sample tests though
<FromGitter> <Blacksmoke16> hmm apparently it thinks a string is coming from somewhere
<FromGitter> <Blacksmoke16> oh i see
<FromGitter> <Blacksmoke16> real tests include some strings too
<FromGitter> <Brandongoodman615> oh!
<FromGitter> <Blacksmoke16> val.is_a?(String | Char)`
<FromGitter> <Blacksmoke16> or really your block could also just be `Int32.new e`
<FromGitter> <Brandongoodman615> ah, I get it now
<FromGitter> <Blacksmoke16> πŸ‘
<FromGitter> <Brandongoodman615> `x.sum {|e| Int32.new e}` that's pretty!
<FromGitter> <Blacksmoke16> indeed
<FromGitter> <Brandongoodman615> is there any reason to do `Int32.new e` over `e.to_i`
<FromGitter> <Brandongoodman615> And holy shit was I making it harder than necessary lol
<FromGitter> <Blacksmoke16> they essentially do the same thing
<FromGitter> <Brandongoodman615> I really appreciate the help man!
<FromGitter> <Blacksmoke16> np
chemist69 has quit [Ping timeout: 245 seconds]
chemist69 has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <Blacksmoke16> Just gotta get used to the type system
<FromGitter> <Blacksmoke16> Would happen with any statically typed lang
<FromGitter> <Blacksmoke16> When coming from a dynamic language
chemist69 has quit [Ping timeout: 276 seconds]
chemist69 has joined #crystal-lang
ht_ has joined #crystal-lang
alex`` has joined #crystal-lang
_whitelogger has joined #crystal-lang
alex`` has quit [Ping timeout: 268 seconds]
alex`` has joined #crystal-lang
<FromGitter> <bararchy> Nice to see our Neural Net lib is helpful for others :) https://github.com/suruja/learner
sagax has joined #crystal-lang
<FromGitter> <j8r> :-)
<FromGitter> <zsxawerdu> I been monitoring crystal for some time now about 1-2 years(?) .. Its at the point its just as fast as golang.
<FromGitter> <zsxawerdu> the syntax is simple like. i guess my main question / thought, i do not see it activity in github regarding web frameworks or other things i consider a good healthy sign.
<FromGitter> <zsxawerdu> whats true, i can hire a ruby developer and its zero downtime for them to use the crystal code
<FromGitter> <asterite> there's lucky framework which is quite active
<FromGitter> <zsxawerdu> ok, ill take a look , use the guide and check out the forum(s) on it
<FromGitter> <tenebrousedge> I want a percent literal syntax for character arrays
<FromGitter> <tenebrousedge> ```%c(a b c) #=> ['a', 'b', 'c']```
alex`` has quit [Ping timeout: 245 seconds]
alex`` has joined #crystal-lang
alex`` has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
Raimondii has joined #crystal-lang
oprypin_ has joined #crystal-lang
maxpowa_ has joined #crystal-lang
Raimondi has quit [*.net *.split]
oprypin has quit [*.net *.split]
maxpowa has quit [*.net *.split]
maxpowa_ is now known as maxpowa
Raimondii is now known as Raimondi
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Client Quit]
<FromGitter> <zsxawerdu> am i making this to diffucult, Class Me::Show < BrowserAction.
<FromGitter> <zsxawerdu> BrowserAction is the base class
<FromGitter> <zsxawerdu> Me::Show is what? it looks like a nameshpace
<FromGitter> <zsxawerdu> oh my god i got it, my bad. its namespace after filepaths
<FromGitter> <Blacksmoke16> It's a way of namespacing a class
<FromGitter> <Blacksmoke16> Functionality the same as making a module called Me and defining the class in there
<FromGitter> <zsxawerdu> Tell me what book i should read so I do not have to ask these questions in public. =)
<FromGitter> <zsxawerdu> or course, i usually do rust/golang, trying out crystal for a internal dashboard app
<FromGitter> <zsxawerdu> i want to get this done as fast as possible
<FromGitter> <Blacksmoke16> https://crystal-lang.org/reference/
<FromGitter> <Blacksmoke16> And the API docs are your best bet
<FromGitter> <zsxawerdu> tbh, i should watch a ruby video and call it the day
<FromGitter> <zsxawerdu> i hever touched ruby cause it was always slow as hell
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
<FromGitter> <Daniel-Worrall> What's a good db lib for abstracting common statements like select/update/etc
<FromGitter> <Daniel-Worrall> I'm using the pg driver if it's important
<FromGitter> <Daniel-Worrall> I imagine the web frameworks have their own stuff built for it
hightower3 has joined #crystal-lang
<FromGitter> <Blacksmoke16> Clear Granite or avyem or something like that
<FromGitter> <Blacksmoke16> Don't remember the exact name, is the one lucky has
<FromGitter> <Daniel-Worrall> avram
<FromGitter> <Blacksmoke16> Yea that's it
gangstacat has quit [Quit: Ĝis!]
gangstacat has joined #crystal-lang
commavir has quit [Ping timeout: 245 seconds]
commavir has joined #crystal-lang
ht_ has quit [Quit: ht_]
sagax has quit [Remote host closed the connection]
sagax has joined #crystal-lang
<FromGitter> <Blacksmoke16> im only really familiar with Granite tho. which do use depends on what you're looking for
<FromGitter> <Blacksmoke16> which to use*
<FromGitter> <nsuchy> If anyone here wants to chime in https://github.com/amberframework/granite/issues/362
<FromGitter> <Blacksmoke16> talked about it, pretty sure its already possible ^ Granite supports native array types with PG
hightower3 has quit [Ping timeout: 246 seconds]
alex`` has quit [Ping timeout: 265 seconds]
alex`` has joined #crystal-lang
alex``` has joined #crystal-lang
alex`` has quit [Ping timeout: 240 seconds]
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d86b40204053c5b3d9c668d]
<FromGitter> <Blacksmoke16> new feature i added
<FromGitter> <Blacksmoke16> debating if its worth keeping tho...hmm