<FromGitter>
<m-o-e> looks like that site has a booboo lol
<FromGitter>
<girng> lol
sz0 has quit [Quit: Connection closed for inactivity]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 250 seconds]
rohitpaulk has joined #crystal-lang
akaiiro has quit [Ping timeout: 245 seconds]
rohitpaulk has quit [Remote host closed the connection]
ravernkoh has joined #crystal-lang
<FromGitter>
<asterite> jokke: cool, I'll join, though my timezone makes it so that I have to do it like 12 hours after it's published
ravernkoh has quit [Remote host closed the connection]
<FromGitter>
<DanilaFe> Joining that leaderboard too :)
ashirase has quit [Ping timeout: 250 seconds]
ashirase has joined #crystal-lang
<FromGitter>
<mpcjanssen> @greenbigfrog instead of the loop wich checks for continue, you can use INPUT.cycle.each this goes repeatedly through INPUT
* FromGitter
* mpcjanssen test driving Crystal wit AoC and happy thus
<FromGitter>
<mpcjanssen> far
<FromGitter>
<vlazar> Old question comes back to me again :) Is adding an implicit block argument for cleaner syntax is a good idea or possible at all in current Crystal syntax? ⏎ ⏎ > Does anybody know if Kotlin-like syntax was considered for Crystal blocks? For example: ⏎ > ``` ⏎ > ints = [1, 2, 3] ... [https://gitter.im/crystal-lang/crystal?at=5c03b1d0e827492525872be9]
<FromGitter>
<greenbigfrog> @mpcjanssen Thanks
<FromGitter>
<asterite> Just use a block argument name. It's not a big deal.
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<FromGitter>
<vlazar> Sure, but implicit `it` feel just a bit cleaner than adding `|it|` and `&.` shortcut is a separate syntax and limited to single method call.
Yxhuvud has joined #crystal-lang
Jenz has joined #crystal-lang
<Jenz>
Join the crystal leaderboard of AoC 2018 guys!
<Jenz>
And share the leaderboard with fellow crystallers (or whatever we call ourselves), the more the merrier!
<Jenz>
(Though AoC puts a maximum of 200 people per private leaderboard)
<FromGitter>
<greenbigfrog> Anyone ever had issues with crystal not resolving addresses properly when running inside docker and trying to connect to a other container on the same overlay network?
* Jenz
has never even used docker...
<Jenz>
And hehe, crystal stdlib has some juicy stuff for part to of todays AoC challenge
<Jenz>
s/part to/part two/
<FromGitter>
<greenbigfrog> mind sharing your solution?
<Jenz>
I haven't completed part 2 yet, not even started really, just read the desc and got some ideas
<FromGitter>
<greenbigfrog> When you do, I'd like to see a better implementation then mine...
<FromGitter>
<greenbigfrog> The address resolving has to do with static compiling glibc... https://github.com/crystal-lang/crystal/issues/6099 ⏎ Smh I could've googled this earlier and spared myself trying to fix this for over half a day...
<FromGitter>
<asterite> It would be nice to have a place to see the Crystal repos for the solutions of adventofcode of this year
<Jenz>
This gets the right answer for the example: https://play.crystal-lang.org/#/r/5obb, but I get a wrong one for the real input, anyone see what Im missing?
<Jenz>
Actually, I think I know
<Jenz>
Or not...
<Jenz>
Ah it was that after all
<FromGitter>
<meltheadorable> I'm a ruby dev trying to learn crystal and, presently, feeling silly because this doesn't work: ⏎ ⏎ ```arr = [] of Int32 ⏎ (1..100).each_with_index do |n, index| ⏎ arr[index] = n ⏎ end``` ⏎ ⏎ i vaguely understand *why* it doesn't work (the array is size 0, so `arr[0]` is out of bounds), but is there any way I could do something vaguely similar in the future without knowing in advance
<FromGitter>
... how big to initialize the array or using append? I wanted to handle a less straightforward case where I had integer keys that weren't necessarily sequential and I wanted to insert them one at a time, I ended up having to replace it with a hash, which might have been the more correct data structure, but i use this sort of thing often enoug ... [https://gitter.im/crystal-lang/crystal?at=5c03dedaa6c29a1037d01236]
<Yxhuvud>
asterite: thanks for each_combination, it gave me a cleaner and shorter require-free solution to part2. :)
<FromGitter>
<mpcjanssen> @meltheadorable if you have holes in your array, a hash is the proper data structure
<FromGitter>
<meltheadorable> @mpcjanssen fair enough, if that's the answer then that's the answer :P
<FromGitter>
<proyb6> I seen some Crystal code in Day 2 P1 use map, chars and groul_by
<FromGitter>
<proyb6> Why not use ".find" to simplify?
<Yxhuvud>
proyb6: I don't understand. Care to gist some code to explain how the code for that wood look?
<FromGitter>
<proyb6> Hmm, Can post here in the open?
<Yxhuvud>
better use a gist, some may not want to be spoiled.
<FromGitter>
<proyb6> I will private message you
<FromGitter>
<proyb6> Ok a gist
<FromGitter>
<mpcjanssen> @proyb6 thanks for the tip
<FromGitter>
<proyb6> Yxhuvud, I found your code quite nice too but wasn't sure on the occurrence parts, think it work as such. I'm off to do something else.
<FromGitter>
<proyb6> @ilanusse It's an Advant of Code game
<FromGitter>
<j8r> I'm now satisfied with the 25% performance increased vs JSON, time to do Serializable stuff
dabedoc has quit [Ping timeout: 256 seconds]
<FromGitter>
<ilanusse> Macros are pretty fun now that I've figured out how to call methods with them
Jenz has quit [Ping timeout: 268 seconds]
_whitelogger has joined #crystal-lang
akaiiro has joined #crystal-lang
<FromGitter>
<greenbigfrog> Currently trying to containerize a few crystal applications. ⏎ `Unhandled exception in spawn(name: T Bot): SSL_connect: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed (OpenSSL::SSL::Error)` ⏎ I was using a multistage build until I now started noticing the issue above (which is due to missmatching openssl versions at build and runtime?) ⏎ I could of course fix this,
<FromGitter>
<j8r> for the moment you could use alpine with 0.26.0 and compile crystal 0.27.0 inside
<FromGitter>
<greenbigfrog> 88MB vs 15MB is acceptable for now 😄 thanks for the debian:<sth>-slim tip
<FromGitter>
<Blacksmoke16> np
<FromGitter>
<BlobCodes_gitlab> Hello, I tried to use the OAuth2 library, but when I want to get the token, the request takes a minute and says "Error reading socket: Connection reset by peer". ⏎ ⏎ Code: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c041aaf8fa4333e392ab01a]
<FromGitter>
<jgaskins> @BlobCodes_gitlab Whenever you get `Connection reset by peer` trying to make an HTTP request, nearly 100% of the time it's because you're making an HTTP request to a server expecting HTTPS or vice versa. Your code should work if you pass `tls: true` to `post`.
<FromGitter>
<jgaskins> I'm surprised the Ruby version doesn't give the same error. I've always had to pass `use_ssl: true` in HTTPS requests with `Net::HTTP`.
<FromGitter>
<girng> i still don't understand macros and never will <laughing while crying.gif>
<FromGitter>
<ilanusse> What's Crystal's equivalent to Rack?
<FromGitter>
<bew> hey @girng you're back
<FromGitter>
<ilanusse> @girng Just imagine the preprocessor replaces any macro calls with the entire macro code
<FromGitter>
<j8r> @girng they generates source code, instead of your hands writing this code
<FromGitter>
<girng> the only macro code that i used, was opyrin's macro_everything macro, which does DB.mapping and JSON.mapping. it's all i ever needed so far LOL
<FromGitter>
<girng> @j8r yeah just the thought of that makes my head explode
tdc has quit [Quit: Leaving]
<FromGitter>
<girng> @bew =] glad to be back. finished up my MasterServer, now finishing up my GameServer (that has the tickrate)
<FromGitter>
<BlobCodes_gitlab> Trying to get the Microsoft Office365 OAuth2 to work is just pain.. ⏎ ⏎ The normal OAuth2 module in Crystal just won't work - you need to specify that it has to use tls, but even if you replace the .get_access_token_using_authorization_code() function, the integers are given in Strings and Crystal's OAuth2::AccessToken.from_json wants integers.. Thus it crashes again..
<sagax>
websocket server
<sagax>
girng
<sagax>
as speed websocket server
rohitpaulk has quit [Ping timeout: 268 seconds]
<FromGitter>
<girng> oh really???
<sagax>
yes, i change xD
<FromGitter>
<girng> websocket eh, awesome! were you inspired by @sdogruyol's benchmarking article? hahaha
<sagax>
no no, just change, it's all
<FromGitter>
<girng> i see :D
<sagax>
yes
<sagax>
^_^
akaiiro has quit [Remote host closed the connection]
<sagax>
anyway crystal quicker than ruby
lucasb has joined #crystal-lang
DTZUZO has quit [Ping timeout: 244 seconds]
Renich has quit [Quit: Renich]
Renich has joined #crystal-lang
Renich has quit [Read error: Connection reset by peer]
Renich has joined #crystal-lang
RyanMcCoskrie has joined #crystal-lang
<FromGitter>
<girng> i'm so happy i'm free from javascript on the server
<FromGitter>
<girng> crystal feels so much more nicer. especially the db module. code looks way better and easier to read and the synchronous nature makes it easier to do things with queries
<FromGitter>
<girng> i also did something that dramatically changed the way i program and increased my productivity tenfold
<jokke>
great to hear
<FromGitter>
<girng> i simply changed the text editor's zoom level in godot and vscode ( for crystal code), to around 64%. at first, it was hard to see the code, but i'm used to it now. BUT OMG it affects productivity and increases confidence by a lot. because it makes me feel like i have more room to "write stuff" and the more space in the editor, makes me feel like i can write more code
<FromGitter>
<girng> ya'll think i'm crazy prob lol, but honestly it's the truth. it helps!
RyanMcCoskrie has quit [Remote host closed the connection]
moei has quit [Quit: Leaving...]
vikaton has joined #crystal-lang
ua has quit [Ping timeout: 250 seconds]
<oprypin>
well what do you know, Crystal's color in Github stats is actually black now