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 has joined #crystal-lang
Raimondi has joined #crystal-lang
<FromGitter> <girng> gn
_whitelogger has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
DTZUZU has quit [Quit: WeeChat 2.2]
non-aristotelian has quit [Quit: non-aristotelian]
gangstacat has quit [Quit: Ĝis!]
<FromGitter> <proyb6> @j8r I don't know if this work as opp to ```.<= 0x04FF``` ⏎ https://carc.in/#/r/5sne
dannyAAM has quit [Ping timeout: 252 seconds]
<FromGitter> <proyb6> I think it's a bug?
gangstacat has joined #crystal-lang
dannyAAM has joined #crystal-lang
red_menace has joined #crystal-lang
red_menace has quit [Client Quit]
Dreamer3 has joined #crystal-lang
DTZUZO has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <elorest> How evil would it be if `to_h` returned a NamedTuple?
<FromGitter> <DanilaFe> @anamba how do you feel about today's AoC?
<FromGitter> <anamba> @DanilaFe so close
<FromGitter> <DanilaFe> This is one is terrible, imo
<FromGitter> <DanilaFe> adding so many rules tripled the time to do the puzzles
<FromGitter> <anamba> hmm. at first i was doing it in a somewhat optimized way, but my results were slightly different. then, i fixed it to run in exactly as specified, but now it's incredibly slow
<FromGitter> <DanilaFe> I don't even care about slow
<FromGitter> <DanilaFe> I just want to be done
<FromGitter> <DanilaFe> it's been 3.5 hours
<FromGitter> <anamba> well, it's so slow that it's not going anywhere. i know what i need to do but can't quite summon that knowledge
<FromGitter> <DanilaFe> oh, raelly?
<FromGitter> <DanilaFe> mine is not nearly that slow
<FromGitter> <DanilaFe> and I run a* on every unit step
<FromGitter> <DanilaFe> so....no optimization in mind right now
<FromGitter> <anamba> oh... i converted it and .... still slow. damn
<FromGitter> <DanilaFe> I'm off by 3 points and 1 turn in ONE of the reference inputs
<FromGitter> <anamba> unfortunately that means the real thing is gonna be way off :)
<FromGitter> <DanilaFe> yeah, but it ends in the same damn spot
<FromGitter> <DanilaFe> so I've no idea what the subtle incorrect behavior is
<FromGitter> <DanilaFe> darn! Literally, one case, one turn off
<FromGitter> <DanilaFe> ok, I'm correct in all the test cases. let's see how fast my input runs
<FromGitter> <DanilaFe> > That's not the right answer; your answer is too low. If you're stuck, there are some general tips on the about page, or you can ask for hints on the subreddit. Please wait one minute before trying again. (You guessed 202741.)
<FromGitter> <anamba> i'm pretty sure my program will output the right answer if it ever finishes
<FromGitter> <anamba> πŸ˜†
<FromGitter> <DanilaFe> I dare say I may be filtered today
<FromGitter> <DanilaFe> I even thought I had a clever solution
<FromGitter> <DanilaFe> A* with a heuristic that grave priority to paths that go up and left
<FromGitter> <anamba> hey, changing one Array to a Deque made things a lot faster. still slow but there's hope
<FromGitter> <anamba> ok that's a new one `Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS`
<FromGitter> <DanilaFe> > That's not the right answer; your answer is too high. If you're stuck, there are some general tips on the about page, or you can ask for hints on the subreddit. Please wait one minute before trying again. (You guessed 251370.)
<FromGitter> <DanilaFe> I can probably binary search at this point
<FromGitter> <DanilaFe> I have high and low bounds, after all :D
<FromGitter> <anamba> don't, the delay penalty gets extreme quickly
<FromGitter> <DanilaFe> 5 minutes is the highest I've gotten
<FromGitter> <anamba> the day i never finished it went to 10 for me
<FromGitter> <anamba> i'm not sure whether there is a limit
<FromGitter> <DanilaFe> good thing I only need log(251370 - 202741) / log(2) = 16 iterations
<FromGitter> <anamba> uhhhhh i need more memory
<FromGitter> <DanilaFe> @yxhuvud how's your progress?
foxxx0 has quit [Quit: foxxx0]
<yxhuvud> need more test cases.
<FromGitter> <DanilaFe> does your input pass all the test cases too?
<yxhuvud> yup
<yxhuvud> speed is not an issue though.
<FromGitter> <DanilaFe> same. I've found that varying my a* heuristic changes the answer by 10-15%, but all test cases pass
<FromGitter> <anamba> i'm up to 10.22 GB memory used. this is embarrassing.
<FromGitter> <DanilaFe> you know what's really embarassing?
<FromGitter> <anamba> but making progress
<FromGitter> <DanilaFe> it's been 4.5 hours and only around 300 people solved the problem, last time I checked
<yxhuvud> ouch.
<FromGitter> <anamba> still chugging
<yxhuvud> mine take less than a second to run with real input, so you should optimize your things better.
<yxhuvud> wrong answer though, but as far as I can see the path finding is correct.
<FromGitter> <DanilaFe> what are you using for path finding?
<FromGitter> <DanilaFe> speed's not an issue in mine, either
<yxhuvud> just regular broad first with dupe detection
<FromGitter> <DanilaFe> I still think my A* with reading order heuristic is pretty clever
<FromGitter> <DanilaFe> not clever enough for a correct answer though
foxxx0 has joined #crystal-lang
<FromGitter> <anamba> ah... oh well `Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS`
<FromGitter> <anamba> i will need to find a non-exponential way to do this
<FromGitter> <anamba> thought a simple breadth-first search would be good enough but the paths get too long with all the obstacles :-\
<FromGitter> <DanilaFe> well, Linus is using bfs
<yxhuvud> anamba: your problem is likely that you have no dupe detection.
<FromGitter> <DanilaFe> ah, a binary guess search is not possible
<FromGitter> <DanilaFe> it stops telling you too high or too low when you're close
<FromGitter> <DanilaFe> (I didn't try, just got a different answer)
<FromGitter> <anamba> @yxhuvud yes i think you're right... i thought it was doing some variant of dijkstra's algorithm but i badly mis-remembered it :-D
<FromGitter> <j8r> If you're on linux you can compress the ram with zswap. On macOS AFAIK it's already thr case
<FromGitter> <DanilaFe> I took a solution from /r/adventofcode to sanity check
<FromGitter> <DanilaFe> ran it on my input
<FromGitter> <DanilaFe> and received a value lower than what was "too low" according to the "incorrect answer" message I received before
<FromGitter> <anamba> i suspect some inputs are more difficult than others
<FromGitter> <anamba> not really much you can do about that probably
<FromGitter> <DanilaFe> I have a much more sane answer from another reference solution
<FromGitter> <DanilaFe> it's very close to what I have, but still off
<FromGitter> <j8r> haha @girng , pretty avatar! :)
<FromGitter> <girng> thank you @j8r it was just for you
ashirase has quit [Ping timeout: 240 seconds]
<yxhuvud> I have a lead to what is wrong!
ashirase has joined #crystal-lang
<FromGitter> <DanilaFe> nice!
_whitelogger has joined #crystal-lang
<FromGitter> <j8r> :girning:
<FromGitter> <DanilaFe> HOLY JESUS I GOT IT
<FromGitter> <DanilaFe> (part 1)
<FromGitter> <girng> lol
<FromGitter> <girng> sounds like when i got got my macro thing working a few days ago hahah
<FromGitter> <DanilaFe> https://puu.sh/ChYoZ/84367930cb.png
<FromGitter> <DanilaFe> it is 3 am
<FromGitter> <DanilaFe> I am going to sleep
<FromGitter> <DanilaFe> good luck, Aaron and Linus
<FromGitter> <DanilaFe> goodnight everyone
tdc has quit [Quit: Leaving]
tdc has joined #crystal-lang
<yxhuvud> Gah. That was tough.
Raimondi has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <proyb6> @yxhuvud yep, a large map got memory shot up to a gig, omg
<yxhuvud> That part wasn't tough. I've solved enough search problems to handle that one easily.
<FromGitter> <proyb6> @yxhuvud Amazing short of loc!
Raimondi has quit [Ping timeout: 240 seconds]
azuri5 has joined #crystal-lang
azuri5 has quit [Quit: azuri5]
rohitpaulk has quit [Ping timeout: 246 seconds]
azuri5 has joined #crystal-lang
<FromGitter> <Sija> @RX14 @bcardiff any estimates on when could we expect `0.27.1`?
<RX14> why?
<RX14> as in, what feature/bug do you need(fixed)?
<FromGitter> <Sija> I was thinking of `MIME` atm
<FromGitter> <Sija> it would be nice to move forward with overflowing operators too
<yxhuvud> Hmm. Perhaps I should have put that benchmark in a gist. It ended up pretty long.
Raimondi has joined #crystal-lang
<FromGitter> <bararchy> @girng lol every week new spinoff avatar ;)
<FromGitter> <bararchy> Now crystal logo in eyes?
Raimondi has quit [Ping timeout: 240 seconds]
azuri5 has quit [Quit: azuri5]
tdc has quit [Ping timeout: 250 seconds]
<FromGitter> <j8r> @RX14 the 0.27.1 will allow the update of the Alpine package
<RX14> no,
<RX14> 0.27.0 is being packaged for alpine
<RX14> why do you think that?
<FromGitter> <j8r> I thought we was waiting the 0.27.1 with upstream fix in the spec instead of having a patch?
<RX14> why would you do that?
<RX14> backporting patches is a distro maintainer's job
<FromGitter> <j8r> it's simpler - no custom patch needed
<FromGitter> <j8r> @Sija no ETA, but there is https://github.com/crystal-lang/crystal/milestone/32
<RX14> @j8r yeah, but you have to wait
<RX14> users shouldn't have to wait
<RX14> mps, do you know how long patches usually sit in aports before they get applied?
<FromGitter> <j8r> someone motivated can commit in https://github.com/alpinelinux/aports/pull/5560
<FromGitter> <j8r> the merged time depends, generally it's not really long
Raimondi has joined #crystal-lang
<mps> RX14: some are applied fast and some could stay for months, mostly depends on urgency, devs time and interest
<RX14> oh well
<RX14> it'd be nice if it made the release
<mps> main develepor (ncopa) was on the trip last week, don't know if he is returned
<mps> and I talked with him about pushing 0.27 crystal to next Alpine stable release
<mps> will page him to see if he is back
<mps> btw, I posted one patch which he applied in few minutes before his trip, so sometimes he (and some other devs) are really fast
<RX14> thanks
<mps> and that was not the first time the patches are applied really fast
<mps> but some of my patches wait more than a half year for review
azuri5 has joined #crystal-lang
return0e has quit [Remote host closed the connection]
<mps> RX14: I paged him, will see if he will respond
<FromGitter> <j8r> it would be so great to have an ACME2 client in Crystal :dream:
<FromGitter> <j8r> Does anybody tried H2O, the http server/reverse proxy?
return0e has joined #crystal-lang
azuri5 has quit [Ping timeout: 250 seconds]
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
azuri5 has joined #crystal-lang
azuri5 has quit [Ping timeout: 250 seconds]
<FromGitter> <proyb6> I used H2O but I've not use Crystal behind H2O
<FromGitter> <girng> @j8r how is it compared to nginx?
<FromGitter> <proyb6> @girng I could answer that, H2O does not have a built-in file cache which Nginx has and is useful for WordPress, so I have relied on third-parties WordPress plugin to do the caching. MRUBY in H2O is interesting especially HTTP/2.
<FromGitter> <proyb6> I wish if H2O.cr could be merge with Crystal, it will be perfect
<FromGitter> <j8r> merged?
<FromGitter> <girng> @proyb6 cool. gonna look into it. i've been reading it's much faster
Raimondi has quit [Ping timeout: 240 seconds]
<FromGitter> <j8r> merged in the stdlib?! It won't happen
<FromGitter> <j8r> this is a lib for a specific need
<FromGitter> <j8r> @proyb6 thanks for the feedback
<FromGitter> <j8r> I was searching a http server that have a configuration serialized, to be easily modified by tools
<FromGitter> <j8r> hopefully https://github.com/mholt/caddy/pull/2374
<FromGitter> <proyb6> Yeah I wonder how the Crystal WIP HTTP/2 performance like but Kazuo is working on QUIC is the future protocol for Internet which could be even complicated
<FromGitter> <proyb6> @girng Perhaps
<FromGitter> <proyb6> @j8r You emoji code is exactly I'm looking for :)
<FromGitter> <j8r> @proyb6 nice! I think I'll do a shard for this, next week if I have time :)
<FromGitter> <proyb6> πŸ‘
_whitelogger has joined #crystal-lang
non-aristotelian has joined #crystal-lang
<yxhuvud> proyb6: thanks, but I disagree about it being amazing. I havn't been able to get it down beneath a second in executing time.
<FromGitter> <greenbigfrog> don't you just love burning through your laptop battery by compiling
<FromGitter> <girng> it's the compiler's way of saying thank you
non-aristotelian has quit [Quit: non-aristotelian]
<FromGitter> <j8r> finally, i released https://github.com/j8r/libcrown @bararchy :D
<FromGitter> <j8r> I know you are doing system project in crystal, that's why I'm mentioning you πŸ˜„
<FromGitter> <j8r> I've tried to build a wrapper as safe as possible, and document it the best
<FromGitter> <girng> wow, deleting yt account has increased productivity tenfold. i like it.
<FromGitter> <j8r> @girng what?
<FromGitter> <bararchy> @j8r sweet! I like it
<FromGitter> <girng> @j8r deleting my youtube account* what i meant sry
<FromGitter> <j8r> @girng yes, but here it's about Unix system accounts
Renich has joined #crystal-lang
<FromGitter> <j8r> In crystal, how can I get the current process uid and gid?
<FromGitter> <j8r> *natively, without `\`id -u\``
<oprypin> j8r, https://crystal-lang.org/api/0.27.0/Process.html#pid%3ALibC%3A%3APidT-class-method
Raimondi has joined #crystal-lang
<FromGitter> <j8r> not pid @oprypin, uid and gid. Of course, i could use this to parse /proc/pid/...
azuri5 has joined #crystal-lang
<FromGitter> <drosehn> There's a PR for adding those (uid and gid). I don't remember whether that work has been merged yet.
<FromGitter> <drosehn> Do you need this for some quick-and-dirty program, or do you need "the real" implementation?
<FromGitter> <j8r> I'll use `File.info "/proc/#{Process.pid}"` before the merge @drosehn
<FromGitter> <drosehn> okay.
<FromGitter> <j8r> I remember the PR - a big one
<FromGitter> <drosehn> Well, I have a quick-and-dirty solution which would be fine if you need it for some quick-and-dirty program. But if you're doing something more substantial, then it'd be nice to have the crystal-official solution.
<FromGitter> <drosehn> If *all* that you get is getuid and getgid (and you don't need to modify them), then:
<FromGitter> <drosehn> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c157e190a145b0e24a78d22]
<FromGitter> <j8r> @drosehn thanks!
<FromGitter> <drosehn> maybe change the names on the methods added to `Process`, so you won't run into conflicts when the real changes are part of crystal's standard library.
Raimondi has quit [Ping timeout: 240 seconds]
azuri5 has quit [Quit: azuri5]
<FromGitter> <anamba> @yxhuvud @DanilaFe i fixed my AoC solution this morning, now it's near-instant but... somehow wrong on my real input. currently stepping through to see where it might have gone wrong
<FromGitter> <DanilaFe> welcome to the club
<FromGitter> <DanilaFe> there's a massive space of solutions that work on test inputs an not on main inputs