Recursion Exercises

Recursions are one of those things that are easy to understand in theory, but in practice can take some getting used to. If you're struggling with it here are some exercises that might help you along. Implement Loops Using Recursion Write a function that prints Hello World n times without using loops. Usage example: say_hi(5) # Prints: # 0: Hello World # 1: Hello World # 2: Hello World # 3: Hello World # 4: Hello World What is the maximum value you can pass to the function without raising

Read more

Implementing BFS in Elixir

After 12 days of adventofcode I think I'm starting to understand Elixir's mindset, or at least I'm starting to write code I wasn't able to read 2 weeks ago. Let's try to use my BFS implementation below to explain some Elixir concepts. Graph Representation Before we can dive into the actual algorithm code for breadth first search we need to figure out a way to store the graph. The original problem input arrived in text format and looked like this: 0 <-> 2 1

Read more

How To: Encrypt Large Files with Python and PyNacl

One limitation of pynacl's concise API is its lack of support for buffered reading. When it comes to large files we can't always load all data to memory in one chunk. This is how I dealt with the problem in a recent project. The Mechanism Pynacl can encrypt and authenticate short blocks (<=16kb is the recommended size). With larger files we'll want to read the file in chunks, encrypt and sign each using pynacl's secret box and then HMAC the entire encrypted data. These are

Read more

Insights from Advent Of Code (Week 1)

My first week solving advent of code has almost ended, which makes it a good time to reflect on the quizzes, my solutions and other solutions I found online. tl;dr Advent of Code is a series of coding quizzes delivered daily during December. Project website is: https://adventofcode.com AOC turned out to be a very nice way to learn a new programming language (I'm learning Elixir). Most puzzles are very easy, as seen in the leaderboard times. Practising a short coding quiz every day

Read more

My Reading List - Dec 2017

Keeping updated on the latest industry trends is an important part of our work. My method is to read new articles briefly as it comes out, and create long readling lists from the ones that look important. I can then read those articles in depth in my own time. It started as a sole project, then I started emailing them locally to friends, and now that I have this blog it seems right to publish it here as well. This is my list of the most

Read more