| Random Link ¯\_(ツ)_/¯ | ||
| Jan 2, 2026 | » | Remarks on Numeric Types
2 min; updated Jan 2, 2026
Inconveniences of Unsigned Types in .NETLanguages like C++ come with convenient support for unsigned integer types where
non-negative values make sense. In contrast, .NET tends to use signed integer types even where unsigned ones would be more intuitive, e.g., .NET is language independent. Languages like C#, F#, and Visual Basic target
.NET implementations. The Common Language Specification (CLS) is the set of
features that are common to all the languages. Of relevance is the fact that
|
| Aug 1, 2022 | » | K-th Smallest Element in Sorted Matrix
5 min; updated Aug 1, 2022
It’s not guaranteed that Using a priority queue that holds the \(K\) smallest elements does not work because the memory usage is \(O(K)\), where \(K\) can be any value in \([1, N^2]\). Furthermore, that doesn’t take into account that the rows and columns are already sorted. ... |
| Jul 31, 2022 | » | Spanning 4-Directional Walks From Origin to Destination w/ Obstacles
3 min; updated Jul 31, 2022
ProblemGiven an \(M \times N\) integer array
Return the number of 4-directional walks from the starting square to the ending square, that walk over every non-obstacle square exactly once. ... |
| Jun 4, 2022 | » | Enumerations in C++
7 min; updated Jun 4, 2022
Unscoped (or Plain or C-Style) EnumerationsPlain (or C-style) enums are entered in the same scope as the name of their enum, and implicitly convert to their integer value, e.g. The name can be omitted if it’s not going to be used, e.g. Unnamed enums are common in code written before alternative ways of specifying integer constants, e.g. ... |
| Jun 4, 2022 | » | User-Defined Types
(6 items)
Classes in C++; Structures in C++; Enumerations in C++; Unions in C++; Dictionary-Based Implementation of Classes and Objects (Python); Inheritance; |
| 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 |
| Mar 16, 2022 | » | AoC 2021 Day 09: Smoke Basin
13 min; updated Mar 16, 2022
massiv; Fusion; Box vs. Unboxed; Connected Components; Data.Set; Monadic map |
| May 3, 2020 | » | Unscrambling Words
2 min; updated May 3, 2020
Problem StatementWrite a program that will take these scrambled words from SolutionPre-process |
quotes Doug McIlroy:
What is the context of this quote?