Showing posts from February, 2017

Blogger and Markdown

Blogger and MarkdownI have been writing on Blogger, on and off, since 2007. In all that time, I've always wanted to find a way to write my blog posts more easily without having to resort to HTML.I am very happy to say that technology has finally caught up with my wish and my last few posts have been written using a combination of:MarkdownVisual Studio Code, with the following plugins: Auto-Open Markdown Previewmarkdownlintvscode-pandocPandocBefore I go any further, I would like to extend many, many thanks to the authors of all this amazing software and to Dave Johnson for his blog post, Build an Amazing Markdown Editor Using Visual Studio Code and Pandoc, which helped me put it all together.At a basic level, I followed Dave's steps pretty closely, so I won't repeat those here. Instead, I will focus on what I had to do to get this setup working.Software installationAll software installation went very smoothly on my Windows machine, with no real problems. This post was made …

AOC 2016 - Day 1, Part 2

AOC 2016 - Day 1, Part 2If you just want to jump into the code, the code for Day 1 is on GitHub.The problemPart 2 adds a small twist to the problem. Instead of just finding an end-point, you have to find the first block that you visit twice.This is not as simple as checking against the end points of each move. Rather each intermediate block that you visit is a candidate for being the final answer.Note about the problemIf you have not finished Day 1, Part 1 yet, the AOC website will not show you the Part 2 text. If you need to do Day 1, Part 1, please see my post on that subject.Do the lines intersect?There are a few ways to solve this problem.Keep a list of all Points (as sets of 2D Cartesian coordinates). Then, every time you move, check if you are passing over an already visited block.Store the lines that represent the moves you have made so far, in order. Then, when making a new move, check whether the new 'line of movement' intersects with any of the previous lines. If the…

AOC 2016 - Day 1, Part 1

AOC 2016 - Day 1, Part 1DisclaimerI want to start this post by saying that when I first started with Advent of Code, I had no idea that each day's problem is divided into two parts. Thus, the code will often look awkward and weird. If I were to re-code the solution, knowing what I know now, I would definitely make some changes.Please note that I have NOT gone back and "fixed up" the code. This is the actual code I wrote to successfully solve each challenge. Are there things I would change - Yes. However, I am much more interested in finding solutions for new problems than I am in fixing this code, especially since no one else is relying on it.I have tried to learn from my mistakes, as will hopefully be obvious from code written for future challenges.The setupThe following theme is used, at least as far as I know, to tie all 25 days worth of AOC problems together.Santa's sleigh uses a very high-precision clock to guide its movements, and the clock's oscillator is …

Advent of Code 2016 - What is it?

Introduction to Advent of Code 2016When developing software as a hobby, it is important to find interesting problems to keep interest high. As I posted earlier, I will be making my future posts based on the Advent of Code challenge for 2016. But, what is Advent of Code?If you're not familiar, here is a description from their website:Advent of Code is a series of small programming puzzles for a variety of skill levels. They are self-contained and are just as appropriate for an expert who wants to stay sharp as they are for a beginner who is just learning to code. Each puzzle calls upon different skills and has two parts that build on a theme.So far, having done 5 days, I've found the problems very interesting and, in at least one case, extremely challenging.This is just meant to be an introductory post. Next post will dive into Day 1.


So, I obviously missed something "profound" when I read the term FizzBuzz for the first time and had no idea what it was talking about. I started digging in and was actually a little astounded (and saddened) by what I read.

I wanted to see if I could some up with something that would work. Obviously, I wasn't in an interview setting with someone breathing down my neck, but this is what I wrote in about 5 minutes. Basic testing shows that it seems to work. So, I don't know who this will help, but I am posting my contribution to FizzBuzz:

Coming back to blogging

Hi All,

It's been a long, LONG time, but I believe I am finally ready to come back to blogging.  It helps that I've finally found a good placed in life (in every way) and am starting to love development again.

I'll be restarting my blogging exercise by walking through my solutions for the Advent of Code challenge for 2016.  I've already got the solutions, in F# of course, for the first 5 days - i.e. 10 problems.  I'll post about those first, then continue with the remaining ones.

This promises to be quite an adventure - at least for me personally.  And I'm looking forward to sharing it with all of you (and learning from all of you as well).

Kind regards.