| Random Link ¯\_(ツ)_/¯ | ||
| May 30, 2022 | » | Templates in C++
4 min; updated May 30, 2022
A template is a class or a function that we can parameterize with a set of types or values. Parameterized TypesThe vector-of-doubles can be generalized to a vector-of-anything type by making it a template: |
| May 12, 2022 | » | Classes in C++
15 min; updated May 12, 2022
A class is a user-defined type provided to represent a concept in the code of a program. Essentially, all language facilities beyond the fundamental types, operators, and statements exist to help define better class or to use them more conveniently. Sometimes I have problems defining the concept that is going to be
encapsulated as a class. Other times, the naming is hard, and I result
to common patterns like |
| Feb 19, 2022 | » | Learning Haskell via AoC 2021
14 min; updated Feb 19, 2022
This page contains remarks on Haskell that I encountered when working with source files that span multiple AoC 2021 problems. and have Haskell solutions. It’ll be nice to compare how they solved the problems. I don’t want to end up perfecting the wrong approach! Setting Up Haskell Env for AoCTo manage dependencies, Cabal and Stack are pretty popular. Stack incorporates the Cabal build system. ... |
| Feb 18, 2022 | » | AoC 2021 Day 01: Sonar Sweep
6 min; updated Feb 18, 2022
Day 1 - Advent of Code 2021: Sonar Sweep.
Eric Wastl.
Part OneAs the submarine drops below the surface of the ocean, it automatically performs a sonar sweep of the nearby sea floor. On a small screen, the sonar weep report (your puzzle input) appears: each line is a measurement of the sea floor depth as the sweep looks further and further away from the submarine. ... |
| Feb 6, 2021 | » | 021. Amicable Numbers
8 min; updated Feb 6, 2021
Problem StatementLet \(d(n)\) be defined as the sum of proper divisors of \(n\) (numbers less than \(n\) which divide evenly into \(n\)). If \(d(a) = b\) and \(d(b) = a\), where \(a \neq b\), then \(a\) and \(b\) are an amicable pair and each of \(a\) and \(b\) are called amicable numbers. For example, the proper divisors of \(220\) are \(1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110\); therefore \(d(220) = 284\). The proper divisors of \(284\) are \(1, 2, 4, 71, 142\); so \(d(284) = 220\). ... |
quotes Doug McIlroy:
What is the context of this quote?