Michael Mraz

+ Follow
since Dec 05, 2018
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Michael Mraz

Originally I had thought to check the distance from each point to the others and keep moving until they were all within 1 of another point.  But, that ended up being overkill.

Tim Cooke wrote:Day 10 was a fun one. It's a pleasant change of tact when you have to use your eyes to solve it rather than getting the computer to do it. The trick was having the computer present you visibly decipherable information but not too much or too little of it. Part 2 was a doddle.

My solution watches for convergence across the Y axis.  Then when it began to diverge again step back 1 second and draw the result.  I ended up with exactly 1 result printed out.  My part 2 answer was available as part of the output from part 1 as I was keeping track of the seconds in my $DEBUG output.  So, I just made it part of the STDOUT.  Only thing I forgot was to step back the seconds counter by 1 to correlate with the result I was printing.  So, my first submission was 1 second too high.

Liutauras Vilda wrote:Watch my beauty:
\[code=scala\]object Day7

I was going to ask what language it was as it looked a bit like Java and Groovy to me.  Quoting your message revealed the code block which you labeled with the language so I got my answer.  Some of the development teams I support use Scala and I had to learn sbt configuration to update their build processes.  Looks interesting.  I should probably learn it.

Tim Cooke wrote:Day 8 . . . Straight forward enough, and even quite happy with the solution design too which is a rare thing.

You used a queue.  I need to learn how to do that.  It's more about thinking through how to process the queue as entries and nested entries are encountered.  I used a recursive function to get to the metadata for the first entry and then parse backwards through all the children as they were encountered.

Tim Cooke wrote:Jeepers that was hard work! Satisfying to get all of Day 7 done though.

Reading through your steps2.py was a combination of "That logic makes sense" and "WTF does that do?" to me.  Then I realized you were keeping track of state, for all aspects of a task, on each worker and it made a lot more sense.  Less potential for array values out of synchronization when they all belong to the same object.

Michael Mraz wrote:Say 7 is beginning on a [ur=https://xkcd.com/323/l]Balmer Curve[/url] with the intention of making top 200 for part 1.  Wish me luck.

No way to edit posts on this forum, eh?  I can see how I've slipped out of the  curve
Say 7 is beginning on a [ur=https://xkcd.com/323/l]Balmer Curve[/url] with the intention of making top 200 for part 1.  Wish me luck.
Also, I vaguely remember a taxicab distances problem from last year.  Different problems for both parts, but the same logic applied. At least I knew how to calculate the distances.

Tim Cooke wrote:I wonder how Michael "I'm not a software engineer by trade but is kicking all our butts" Mraz found today's day 6 puzzle?

I got part 1 done correctly and ran into the bug with certain input sets failing with correct solutions.  Saw the problem reported in the reddit thread so I grabbed the part 2 using a second, anonymous account I am submitting on which didn't have the bug and wrote up my part 2 solutions.  When I woke up Thursday mornign the bug had been fixed and I submitted both parts successfully.  (Explaining in case anyone is looking at the JSON API output and sees the timestamps on my day 6 submissions within minutes of each other.)

I pushed my code this evening.  Visualizing the grid like in the example and how to place distances and transitions through each coordinate when traversing the optimal distance route between points seemed the way to go.  The key was to make a grid of all the input points, measure the distances and the number of times each coordinate crossed the points between each point.  Then I made a set with all the points in a 10K grid and joined the grid counts into the set.

I had to lean hard on perl's array references and tying.  Learned about flattened zipping 2 arrays into a multi-dimensional array too.  Was way more complicated than I had hoped.

You Java programmers got me all jealous with your varied data types in the stdlib.  I have hash, array and scalar to work with because perl is the only thing I can program quickly in.
I just refactored my day 5 part 2 to use the reacted polymer for the a..z iteration and reduced the runtime from


23 times faster is good, right?

Liutauras Vilda wrote:So you say you don't write tests too

I'm not a software developer by trade.  I do DevOps with a splash of Site Reliability Engineering.  Is that a good excuse for not doing TDD?
I usually default to lots of type statements and using the smaller example input set to see what my logic is doing.

Michael Mraz wrote:I used to work with Tim Cook

=~ s/Cook/Cooke/;
I got my Day 5 Part 1 done so fast that could have made the top 100.  Except, I forgot perl $#array returned the index and not the size.  So, my answer was off by 1.  I spent the next 33+ minutes trying to figure out what I did wrong.

Part 2 took an hour, but over half that was reruns with debug output because I didn't put [] around my uppercase+lowercase letter for the regex to strip the letter from the word.

To those asking "Who the heck is this random person?".  I used to work with Tim Cook at the Chicago Mercantile Exchange and participated in his leaderboard last year.  So, by default I showed up for this year and Tim invited me to this discussion.  My code is in a repo linked on my github from my AoC account.  I've also carried the tradition into my new employer and have a leaderboard for my teammates and a chat channel we're bantering about the contest on.