ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.22.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
sp4rrow has joined #crystal-lang
Aytan72 has quit [Remote host closed the connection]
Aytan72 has joined #crystal-lang
Aytan72 has quit [Ping timeout: 240 seconds]
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 260 seconds]
p0p0pr37_ is now known as p0p0pr37
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<FromGitter> <codingphasedotcom> hey
<FromGitter> <codingphasedotcom> i'm having an issue with mysql can anyone help me
<FromGitter> <codingphasedotcom> Error in src/rocky.cr:1: while requiring "./config/database.cr" ⏎ ⏎ require "./config/database.cr" ⏎ ^ ⏎ ... [https://gitter.im/crystal-lang/crystal?at=590a8a04edf919574a75208b]
<FromGitter> <fridgerator> is that the full error message? seems like something is missing
<FromGitter> <codingphasedotcom> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=590a8acd4098d96d34348939]
bmcginty has joined #crystal-lang
<FromGitter> <codingphasedotcom> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=590a8ae312d2409935c42af6]
<FromGitter> <fridgerator> what crystal version?
<FromGitter> <fridgerator> in 0.22.0 `WeakRef#target` was changed to `WeakRef#value`
<FromGitter> <fridgerator> so it looks like possibly an older crystal version?
<FromGitter> <codingphasedotcom> thank you that worked
<FromGitter> <fridgerator> :+1:
<FromGitter> <codingphasedotcom> just had to upgrade to new crystal version didn't know they upgraded already
<FromGitter> <Sija> checkout https://github.com/crystal-lang/crystal/blob/master/CHANGELOG.md for the list of goodies
<FromGitter> <codingphasedotcom> cool thanks
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
Aytan72 has joined #crystal-lang
splitty___ has quit [Read error: Connection reset by peer]
splitty_ has joined #crystal-lang
Aytan72 has quit [Ping timeout: 240 seconds]
avdi_ has joined #crystal-lang
Yxhvd has joined #crystal-lang
bjz has joined #crystal-lang
sp4rrow has joined #crystal-lang
SuperChickeNES has joined #crystal-lang
gewo has quit [*.net *.split]
DeBot has quit [*.net *.split]
Yxhuvud has quit [*.net *.split]
avdi has quit [*.net *.split]
ChickeNES has quit [*.net *.split]
avdi_ is now known as avdi
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gewo has joined #crystal-lang
SuperChickeNES is now known as ChickeNES
bjz has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Raimondi has joined #crystal-lang
Raimondi has quit [Quit: WeeChat 1.8-dev]
Raimondi has joined #crystal-lang
Aytan72 has joined #crystal-lang
Aytan72 has quit [Ping timeout: 260 seconds]
<FromGitter> <elorest> Is there a way to get `”asjdfjs”.to_i to return 0 instead of erroring
<FromGitter> <elorest> ```icr(0.22.0) > "ajsdfj".to_i ⏎ Invalid Int32: ajsdfj (ArgumentError)``` [https://gitter.im/crystal-lang/crystal?at=590ab3ccd32c6f2f0967f42d]
<FromGitter> <drosehn> I haven't tried it, but how about: `”asjdfjs”.to_i rescue 0`
<FromGitter> <drosehn> well, using plain-double-quotes instead of smart-double-quotes.
<FromGitter> <drosehn> (hmm, looks like the answer is "no, that doesn't work". darn)
<FromGitter> <drosehn> in any case, g'night.
<FromGitter> <elorest> @drosehn Turns out the solution is to pass in a block. `"ajsdfj”.to_i{0}`
Aytan72 has joined #crystal-lang
Aytan72 has quit [Ping timeout: 245 seconds]
mark_66 has joined #crystal-lang
<FromGitter> <KCreate> Wow, only 3 more stars and my charly-lang/charly (https://github.com/charly-lang/charly) repository has 100 stars!
<FromGitter> <bew> @KCreate only 1 left now ;)
<FromGitter> <KCreate> lol
<FromGitter> <KCreate> I've never thought it would actually get more than 10
bjz has joined #crystal-lang
Aytan72 has joined #crystal-lang
Aytan72 has quit [Ping timeout: 246 seconds]
<FromGitter> <drosehn> @elorest : ah, thanks for the info. I could see that coming in handy at some point in my future.
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
zipR4ND has joined #crystal-lang
wuehlmaus has quit [Quit: Lost terminal]
scottj has joined #crystal-lang
zipR4ND has left #crystal-lang [#crystal-lang]
zipR4ND has joined #crystal-lang
blufor has quit [Ping timeout: 240 seconds]
wuehlmaus has joined #crystal-lang
<FromGitter> <schoening> @KCreate bam! Jeg 100 :smile:
<FromGitter> <schoening> Bam *
<FromGitter> <KCreate> :tada: :tada:
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 240 seconds]
blufor has joined #crystal-lang
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 260 seconds]
splitty__ has joined #crystal-lang
splitty___ has joined #crystal-lang
splitty_ has quit [Ping timeout: 240 seconds]
splitty__ has quit [Ping timeout: 268 seconds]
bmcginty has quit [Ping timeout: 258 seconds]
bmcginty has joined #crystal-lang
<FromGitter> <KCreate> Are Codecamp sessions being recorded? I'm particularly interested in the Day 2 "Oh my compiler" talk
<FromGitter> <fridgerator> ^^ same
Aytan72 has joined #crystal-lang
<FromGitter> <mverzilli> CodeCamp sessions are not going to be recorded, except for an open Q&A session at the end of day 2, let me check for the registration link
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zipR4ND has quit [Ping timeout: 240 seconds]
yogg-saron has joined #crystal-lang
matp has joined #crystal-lang
matp has quit [Client Quit]
<FromGitter> <krg7880> I attempting to create a new Date object and running into the following error. Any ideas on what I'm doing wrong? Looks like the format string is breaking it. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=590b3ce6e1b61e93281140ce]
bjz has joined #crystal-lang
<FromGitter> <krg7880> Actually, this seems to work (note the format is the same) so guessing it may be a bug with the Time.new!? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=590b3d8abedc54b621c91a5e]
<FromGitter> <l3kn> `Time.new` creates an `Time` object, not a string
<FromGitter> <l3kn> so at the time you are constructing it, there is no need to pass in the format. To get the string you can use `time.to_s("%a %b %d %Y %T")`
<FromGitter> <krg7880> Makes sense... But I believe the document says I can pass the format at the time of construction, no?
<FromGitter> <l3kn> you mean the `kind` parameter?
<FromGitter> <krg7880> Yeah, guess I'm misunderstanding that bit
<FromGitter> <krg7880> Oh, ok!
<FromGitter> <krg7880> Thanks! This makes sense now :-)
<FromGitter> <bew> yw ;)
zipR4ND has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jokke has quit [Quit: WeeChat 1.7.1]
jokke has joined #crystal-lang
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <krg7880> Are there any methods to determine if a given date is DST?
mark_66 has quit [Remote host closed the connection]
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
bmcginty has quit [Ping timeout: 260 seconds]
bmcginty has joined #crystal-lang
<FromGitter> <Sija> @elorest yes, you can use `#to_i?`
<FromGitter> <Sija> see https://crystal-lang.org/api/0.22.0/String.html#to_i%3F%28base%3AInt%3D10%2Cwhitespace%3Dtrue%2Cunderscore%3Dfalse%2Cprefix%3Dfalse%2Cstrict%3Dtrue%29-instance-method
<RX14> got my crystal stickers!
<FromGitter> <fridgerator> :+1: :clap: :sparkles:
<FromGitter> <sdogruyol> :+1:
<FromGitter> <bew> Cool! @RX14 which ones?
<RX14> the giveaway ones
<FromGitter> <sdogruyol> rad
<FromGitter> <sdogruyol> @RX14 how did you fix techempower benchmark ?
<FromGitter> <sdogruyol> did you use Kemal master?
<FromGitter> <sdogruyol> oh looks like
<FromGitter> <sdogruyol> have you tested on your local?
<RX14> yes I have
<RX14> @sdogruyol at the end of each benchmark run, when all the HTTP connections disconnect, there's a lot of "Error writing file: Broken pipe" errors
<FromGitter> <sdogruyol> ugh
<FromGitter> <sdogruyol> not good
<RX14> well it doesn't affect performance
<RX14> and I think the errors really should just be eaten up by kemal
<RX14> idk
<RX14> it's very hard to detect whether it's a legit error or not
<FromGitter> <sdogruyol> they're just warnings right?
<RX14> yeah
<FromGitter> <sdogruyol> it confuses me also
<RX14> all it means is the client ended the TCP connections while kemal was sending the response
<FromGitter> <sdogruyol> how's the performance
<RX14> it's... okay
<RX14> i can't really tell
<RX14> since it's in a VM
<RX14> it seems to do pretty OK vs go now
<RX14> but we can't really tell still
<FromGitter> <sdogruyol> yeah
<FromGitter> <sdogruyol> a vm vs 40 core instance :D
<RX14> well the problem is that it's 40 shite cores
<RX14> which really is disadvantageous to crystal
<FromGitter> <sdogruyol> you mean with low ghz?
<RX14> low singlecore performance
<RX14> I think
<RX14> cpubenchmark doesn't really have a benchmark available
<RX14> which sucks
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master: https://git.io/v9zhu
<crystal-gh> crystal/master d2dcc02 Brian J. Cardiff: Fixes #4378 sample/tcp_server.cr
wontruefree has joined #crystal-lang
<wontruefree> did the UUID patch ever get merged I thought that was merged a while ago but I dont see it
<FromGitter> <Sija> ATM there’s only `SecureRandom.uuid`
<wontruefree> ok
<wontruefree> interesting
<wontruefree> thanks
<wontruefree> what is the most used web framework these days? I was going to try and do a project in Crystal but I see there are many linked in awesome-crystal in various states
<FromGitter> <Sija> Kemal i guess
<FromGitter> <Sija> although it’s rather Sinatra-like barebones
<wontruefree> cool
<wontruefree> yeah I think I had tried that a while ago
<wontruefree> but that is fun
<wontruefree> :)
<wontruefree> thanks
<FromGitter> <Sija> there’s also https://github.com/drujensen/kemalyst
<wontruefree> ok I was looking at https://github.com/kemalcr/kemal
<FromGitter> <Sija> yeah, Kemal is like Sinatra, while Kemalyst is moar comparable to Rails
<FromGitter> <sdogruyol> yeah
<wontruefree> oh cool
<wontruefree> yeah that makes sense
<wontruefree> I mean from what I am seeing
<FromGitter> <redcodefinal> Hey guys, I've been working on a Bitmap library for stumpy_core (https://github.com/stumpycr) and was wondering if anyone's particularly familiar with BMPs and would be willing to take a look at my code (https://github.com/stumpycr/stumpy_bmp/blob/master/src/stumpy_bmp/stumpy_bmp.cr) and let me know if there is anything I can do better. I read up on this tutorial (http://www.instesre.org/howto/BW_image/Reading
<FromGitter> ... they didn't explain some things like color planes and "important" colors. The wikipedia article (https://en.wikipedia.org/wiki/BMP_file_format) was pretty good too.
Cyrus has quit [Read error: Connection reset by peer]
Cyrus has joined #crystal-lang
Cyrus is now known as Guest4409
wontruefree has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wontruefree has joined #crystal-lang
<FromGitter> <fridgerator> are bmp's still used? (serious question)
<FromGitter> <jwoertink> I've seen them used in video games a lot. Like 2d style ones. Not really sure why though
<FromGitter> <fridgerator> I had a pretty mean collection back in middle school
<FromGitter> <redcodefinal> I use them in a couple kinds of projects, only when I need a simple format to store color values without compression.
<FromGitter> <redcodefinal> They are also great for pixel art, so I'd prefer them over PNG or GIF
<FromGitter> <fridgerator> ah ok
<Papierkorb> with PNG you shouldn't have any artifacts either though
<FromGitter> <redcodefinal> I'm mostly using them for this little esoteric language I've been writing. Basically it turns a bitmap into a grid of instructions like befunge. Maybe I wrote the code wrong but I tested it with PNG at the time and was having issues with the colors sometimes being just 1 off. (ex 0x000000 would become 0x010101) Does PNG compression cause this?
<Papierkorb> PNG is loss-less, it shouldn't by itself cause any difference
<FromGitter> <redcodefinal> Hmm must have been something I did then.
olbat has quit [Ping timeout: 240 seconds]
<Papierkorb> Looks like a filter (next section) could cause bytes and thus pixels to be "off" to some degree.
olbat has joined #crystal-lang
<FromGitter> <redcodefinal> > PNG compression method 0 (the only compression method presently ⏎ defined for PNG) ⏎ ⏎ Looks like all that time I spent playing around with the compression slider in GIMP was for nothing. [https://gitter.im/crystal-lang/crystal?at=590b82475c89dc5361777b31]
<Papierkorb> zlib supports differing compression rates, it's not nonsense, but tbh, when I store PNGs, I always use 9
<FromGitter> <l3kn> Maybe the offset is from converting between different bit-depths, I don't think filters could introduce such errors
<FromGitter> <redcodefinal> It's possible, I'm actually trying some stuff out now with StumpyPNG, the last time I tried it I was using some ruby library, maybe RMagick or something.
<RX14> asterite doesn't seem to have been actively working on crystal itself for a while
<FromGitter> <bew> :/
<FromGitter> <redcodefinal> aww bummer
<RX14> i'm sure he'll be coming back but i'm just not sure when
<RX14> I asked about why crystal's been really slow in development recently on the mailing list but didn't get a response from the core team
<FromGitter> <bew> I see
<FromGitter> <redcodefinal> Maybe they are busy getting ready for the CodeCamp? it's only a week away.
<RX14> yeah but it's kind of demoralizing that barely anything seems to get done
<Papierkorb> Noticed something similar, but I wasn't much active in the last month so my perception might be off
<RX14> i don't think it is
<RX14> if you look at the commits to crystal the last few weeks it's pretty obvious
<wontruefree> how big is the core team?
<wontruefree> that is a bummer
<FromGitter> <fridgerator> development does seem to have slowed, however I understand that sometimes a guy needs to take a break
<FromGitter> <redcodefinal> It sucks but so far we have a lot to work with. If crystal isn't getting updates all the time thats fine by me, I mean there are only a handful of features I want right now (generic type restriction without macro hacks (https://github.com/crystal-lang/crystal/blob/857743a1f2dc885fb4dd0fd40623d90cfd5d9388/src/atomic.cr#L13))
<RX14> as I said before I believe it'll pick up again but failing to keep momentum is a failing of the core team
<Papierkorb> well let's be fair, it's not an easy undertaking and I'd guess that they also never did anything like this
<Papierkorb> I think however that having attainable one or two month milestones would be nice
<FromGitter> <fridgerator> It is frustrating, everyone has the taste for windows support and parallelism (v 1.0), and the bountysource donations are higher now than ever
<FromGitter> <redcodefinal> I say use this down time to start porting over what we need to as a community to get to a good level in terms of packages. Good time to get things like telnet done
<RX14> ideally any member of the core team could disappear and crystal would carry on fine
<FromGitter> <redcodefinal> I want offical RPi support before I want Windows but I understand thats the gold standard
<RX14> but that doesn't seem to be the case at the moment
<RX14> we have official RPi support...
<RX14> in that ARM is supported
<RX14> and we even have a debian repo now
<FromGitter> <redcodefinal> Yeah but it's not "official" that being said I am playing around with it right now ;D
<RX14> it is official support
<RX14> it's been official support since the ARM pr was merged
<RX14> it's just that there was no build for it until recently
<RX14> now it's both official and simple
<wontruefree> parallelism seems cool
<wontruefree> I would like that
<FromGitter> <redcodefinal> Huh I didn't know, in the past Ive tried using the apt-get method of install on RPi and it failed because there were no arm targets
<RX14> yes
<RX14> that's different from not having official support
<FromGitter> <redcodefinal> Can we add the repo and `apt-get` now?
<FromGitter> <redcodefinal> on RPi I mean?
<RX14> unofficial support to me means that bug reports will be put at the bottom of the stack
<RX14> but no, the code is in master and bugs for ARM are just as important
<RX14> and yes, now you can apt-get it but you have to use a different repo
<FromGitter> <fridgerator> @redcodefinal http://public.portalier.com/raspbian
<FromGitter> <fridgerator> lol
<FromGitter> <redcodefinal> Thats good to hear. I have a project that uses GPIO and I'd be happy to port GPIO
<FromGitter> <redcodefinal> yeah @ysbaddaden sent that to me
<FromGitter> <redcodefinal> I literally just talked to him about it two days ago
wontruefree has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wontruefree has joined #crystal-lang
<crystal-gh> [crystal] bcardiff closed pull request #4272: Tool: refactor context/expand/implementation in point of traversaling typed defs (master...fix/crystal-tool/refactor-type-processor) https://git.io/vSXB8
Guest4409 has quit [Quit: WeeChat 1.7]
<FromGitter> <mgarciaisaia> :wave: Sorry for the delay
<FromGitter> <mgarciaisaia> I've read the e-mail, I'm about to send the reply
<FromGitter> <Sija> huh, *Art Of Living* is everywhere… maybe they could spend few bucks on Crystal? ;)
<FromGitter> <mgarciaisaia> :)
<FromGitter> <mgarciaisaia> There's nothing that big going on - we're working on Crystal as always, with news and changes... as always :)
bjz has joined #crystal-lang
Ven has joined #crystal-lang
<FromGitter> <Sija> @mgarciaisaia OT: I’d recommend checking out some criticism in regard to AOL, since fake gurus are havin’ a gr8 biz like always, just sayin’... ;)
Ven is now known as Guest59987
<FromGitter> <mverzilli> no worries Sija, I'm pretty sure it's a sarcastic avatar
<FromGitter> <Sija> :+1:
<FromGitter> <mgarciaisaia> OT: before becaming the keen, good-looking guy I now am (?!?!), I *really* used to look like Sri Sri Ravi Shankar ¯\\\_(ツ)\_/¯
<FromGitter> <mgarciaisaia> Anyways, know I'm a nice person and have just sent an update on what's going on - 📬
<FromGitter> <Sija> haha, so now it’s the Sri Sri Ravi’s time to look like/upon you ;)
<FromGitter> <bew> how to be on mailing list? pleeeease? :smile:
<FromGitter> <mgarciaisaia> @bew https://crystal-lang.org/community ;-)
<FromGitter> <bew> is it the newsletter?
<FromGitter> <bew> I thought I subscribed to it, but never received a single mail :/
<oprypin> bew, The crystal-lang Google Group is the mailing list
<FromGitter> <bew> ooooh thanks!
<FromGitter> <Sija> @mverzilli "`Proc` used to format logged messages.” is enough for documentation you’ve requested in #4369?
<FromGitter> <Sija> I’m not rly sure what else to write since it’s imo pretty much self-descriptive
<FromGitter> <Sija> can add "Takes *severity*, *datetime*, *progname*, *message* and *io* as arguments.” for clarity since there r only types shown
<FromGitter> <Sija> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=590b9af1b88c0f5a04264dab]
wontruefree has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zipR4ND1 has joined #crystal-lang
zipR4ND has quit [Ping timeout: 268 seconds]
wontruefree has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
wontruefree has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <mverzilli> No prob, I'll check it out tomorrow and merge, thanks 🙏
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <Sija> :+1:
<FromGitter> <elorest> I’m running into a weird compile issue when trying to convert a namedtuple to hash. ⏎ ⏎ ``` unless args.empty? ⏎ set_attributes(args.to_h) ⏎ end``` ⏎ ⏎ `Can't convert an empty NamedTuple to a Hash` [https://gitter.im/crystal-lang/crystal?at=590bb4e2631b8e4e61a34376]
<FromGitter> <elorest> wouldn’t the fact that I’m saying do it `unless args.empty?` stop that error from happening?
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Guest59987 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <bew> The compiler doesn't handle things like that, only types iirc.. ⏎ @elorest how is `args` defined?
<FromGitter> <elorest> `def initialize(**args)`
<FromGitter> <elorest> so it can clearly end up being empty. which I’m fine with if not for this error.
<FromGitter> <elorest> problem is that I can’t have both `initialize` and `initialize(**args) as they override each other.
<FromGitter> <Sija> try `**options : Object`
<FromGitter> <elorest> @Sija So far that appears to work. thanks.
<FromGitter> <Sija> :+1:
<FromGitter> <bew> why
<FromGitter> <bew> > {a: 1, b: 2}
<FromGitter> <bew> grr https://carc.in/#/r/1zbv
<FromGitter> <Sija> @bew https://carc.in/#/r/1zbx
<FromGitter> <bew> oooh of course...
<FromGitter> <Sija> you’re missing parenthesis needed for compiler to differentate between a `Proc` and a `Hash/NamedTuple`
<FromGitter> <elorest> puts has thrown me off way to many times.
<FromGitter> <Sija> it’s the same story with every method call i think
<FromGitter> <elorest> probably yes. other methods I always put parens. `puts block` to me seems similar to `a = block` so it’s caused me problems in the past
<FromGitter> <bew> so there is an exception for `a = {b: 1}` ? (given `a = anything` handled as a method call is already an exception, I think yes..)
<FromGitter> <Sija> https://carc.in/#/r/1zc2
<FromGitter> <bew> where are initialized the class variables `@@example` ? (in the final program)