Advent of Code 2020

Advent of Code 2020

The Advent of Code is a site that during the month of December, posts computer science questions every day for people to answer. The quicker you answer, the more points you get which puts you on top of the leaderboard.

There is a new problem released every day which consists of two parts. The first part usually involves reading in an input text file with some problem statement and providing a single number as a result. The problem statement comes with an example input and result so you can write test code to make sure your code is working. The input for the challenge is usually very long and much harder to debug and test. When you are finished you enter a number into a box and hit submit. If you get the correct answer, you can continue and complete part 2. The second part is usually harder and builds on the first part, using the same input file. If you get the answer wrong you can retry but after a delay. After completing either part of the problem correctly while logged in you get a star and you can collect 2 stars for every problem.

A large part of the solution is building text reading, which is often a main component to the problem. The next part is finding a reasonably fast solution to the problem. In general there are thousands of input lines, which means O(n**2) solutions are probably okay.

I found the site a great way to challenge my computer science skills. It is a good way to learn a new language. One frustrating part is that it can be quite tricky to debug issues if you get the answer wrong due to the large input size. The site does tell you if you are above or below or how close you are. I found a couple of problems very frustrating as I couldn’t work out what the issues were with my code as they would already be passing the sample input. Another aspect is file and string manipulation. Languages like Python provide great libraries for reading files and manipulating strings, but languages like C don’t and take more time to solve.

Overall though an excellent site and would highly recommend it.

Sharing Files Between Mac and Windows

How to share files network between Mac and Windows

Seems like a pretty simple requirement, but a little more tricky than first thought.

Windows Setup

First, you need to enable file sharing in Windows in the homegroup.

Mac

To the Mac machine to the Windows computer over SMB.

To do that, go to the Finder and select the Go > Connect to Server (Cmd + K).

Then, select smb://, you will be prompted to login and the folder will be available on the Mac machine.

Changing Blog Bases.

Decided to change blog theme from Jekyll to Hyde.

Had some difficulty updating the configuration of the website as it is quite old.

However, github is nice and provides useful error messages when publishing configurations.

Learning Go.

Learning Go.

Decided to look at other languages to learn, tossed up between Rust and Go and decided on Go as I could do in browser learning without a compiler.

Tutorial

At first, I followed through Google’s own tutorial. This gave me some basic understanding of Go’s fundamentals.

Installation

Installing Go is as simple as downloading the package (~330 MB on disk).

IDE

On my Mac I have been using brackets for Django+Python development, and Atom for everything else. I decided to continue using Atom for Go as there are suitable plugins.

Learning through Exercism

By accident, I stumbled across Exercism which has simple exercises to practice learning around 40 different languages.

After installing it using homebrew:

brew update && brew install exercism

You can download exercises, complete and then submit them.

Was able to complete a number of easy tasks in a short amount of time.

Hello World.

Decided to create a blog for my ~ramblings~ thoughts and ideas.