Today, Carlton Gibson posted a wonderful short programming question:
I love little questions like this, and instantly came up with a solution. However, before I shared what I came up with, I took a quick look at the answers, and saw a bevy of very creative solutions.
None of these felt like an awesome solution for me. I’ve had some similar thoughts on some related matters, and it felt like time for a blog post.
I wasn’t able to do Advent of Code 2020 last year because I spent just about every night working on my book. However, one of my goals this year was to complete 107 stars on Advent Of Code. If I can pull that off, I’ll be just 50 stars shy of full completion (of course they are the hard ones left).
As such, I decided to tackle last year after I was done working on my book. I did the first 13 challenges over a week in March, the next 4 in May, and the remaining nine challenges this month. I figured this is a good chance to review my thoughts on each of the puzzles, and what I liked and didn’t like. If you’re interested, check out the repo here.
Someone mentioned to me they thought this was an easier year, and I agree (however, I’ve only finished one other year). The challenges seemed fairly straightforward, I looked forward to solving the problems. I love Advent of Code, so I was glad to complete these challenges. Not as many problems stuck out as memorable as past years, but it was overall enjoyable.
Back in May, I decided to write down my tips and tricks of the month. My hope is that people find them useful (or share even newer tricks for me), but at the very least, writing them down organizes my thoughts (and forces me to write a blog post more than once a year). So here’s what I got for June:
span:nth-child isn’t the nth span (6/22/20)
Shame on me again for not reading docs first.
If I have a CSS rule that specifies `span:nth-child(2n)` (or every 2nd one), it won’t give me the span with id 2 and 4, it will give me the span with 2 and 3! This is because nth-child refers to the sibling group, which is all the elements. From there it finds every second sibling, and then if that sibling is a span, does it apply the styling.
So I’ve decided to do Advent of Code this year again (no surprise there), but this time, I’m encouraging everyone in HSV.py to join me as well.
I’ve completed 8 challenges, and thought it was time for a recap. I plan on breaking down solutions day by day, and then ending with some lessons learned that might help others. I compete each night with ugly hacked together code, then work on refactoring it the next day. What I share is the refactored version (Don’t think I spit something like this out in just an hour). You can find all my code on my GitHub
So let’s get started.
Advent Of Code 2016 – Day 1
SPOILER ALERT: If you have any inkling, any whatsoever, to work on the Advent of Code…. DO NOT READ THIS BLOG POST. DO NOT LOOK AT MY GITHUB PROJECT. It is no fun if you’re not solving it yourself, and you’ll feel so much better about yourself if you can figure it out without looking up an answer. This blog post is not to give away the answer, but instead, is there for people to learn from.
As always, the following code is in my GitHub:
The problem started off simple enough. There is a 9 digit keypad listed:
If you start at the 5 key, and are given directions to move up, down, right or left, multiple times, what are the keys that you end at after each iteration of directions?
Not too bad, and I was picking a language in my wheelhouse, Python. I chose Python 3, since I don’t get much experience with it, but unfortunately, this program did not stretch my knowledge of Python 3. There wasn’t enough meat to the problem to really dive in.
So let’s look at the code:
So a few days ago, I officially submitted my first conference talk! Bdd to the Bone: Test-Driving Web Applications with Behave and Selenium. It’s no secret that testing is close to my heart as far as software enginnering goes, so I wanted to give a talk representing some of my interests. I want to talk about some of the things that went through my head on this.