chore: sync Anki note IDs for arrays-and-refs flashcards
Adds ANKI_NOTE_ID properties after syncing cards to Anki deck. Minor table alignment reformatting from the sync process. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
* Why can't you return a raw C-style array :cpp:arrays:elaborative-why:
|
* Why can't you return a raw C-style array :cpp:arrays:elaborative-why:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ANKI_NOTE_TYPE: Basic
|
:ANKI_NOTE_TYPE: Basic
|
||||||
|
:ANKI_NOTE_ID: 1776793508138
|
||||||
:END:
|
:END:
|
||||||
** Front
|
** Front
|
||||||
Why is returning a raw C-style array illegal in C++?
|
Why is returning a raw C-style array illegal in C++?
|
||||||
@@ -15,12 +16,13 @@ return arr; // ❌ returns pointer to dead stack memory
|
|||||||
* std::array vs int[]: key differences :cpp:arrays:comparative:
|
* std::array vs int[]: key differences :cpp:arrays:comparative:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ANKI_NOTE_TYPE: Basic
|
:ANKI_NOTE_TYPE: Basic
|
||||||
|
:ANKI_NOTE_ID: 1776793508134
|
||||||
:END:
|
:END:
|
||||||
** Front
|
** Front
|
||||||
How does ~std::array<int, 26>~ differ from ~int[26]~?
|
How does ~std::array<int, 26>~ differ from ~int[26]~?
|
||||||
** Back
|
** Back
|
||||||
| Feature | ~int[26]~ | ~std::array<int,26>~ |
|
| Feature | ~int[26]~ | ~std::array<int,26>~ |
|
||||||
|----------------------+-----------+---------------------|
|
|----------------------+---------+--------------------|
|
||||||
| Return by value | No | Yes |
|
| Return by value | No | Yes |
|
||||||
| Copy/assign | No | Yes |
|
| Copy/assign | No | Yes |
|
||||||
| Knows its own size | No | ~.size()~ |
|
| Knows its own size | No | ~.size()~ |
|
||||||
@@ -32,6 +34,7 @@ Same machine code — zero overhead.
|
|||||||
* Task: return character frequency count from string :cpp:arrays:production:
|
* Task: return character frequency count from string :cpp:arrays:production:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ANKI_NOTE_TYPE: Basic
|
:ANKI_NOTE_TYPE: Basic
|
||||||
|
:ANKI_NOTE_ID: 1776793508129
|
||||||
:END:
|
:END:
|
||||||
** Front
|
** Front
|
||||||
Write a function that counts character frequencies in a string and returns the result. The string has only lowercase letters.
|
Write a function that counts character frequencies in a string and returns the result. The string has only lowercase letters.
|
||||||
@@ -49,6 +52,7 @@ std::array<int, 26> calc(const std::string& str) {
|
|||||||
* Stack vs heap: std::array vs std::vector :cpp:arrays:comparative:
|
* Stack vs heap: std::array vs std::vector :cpp:arrays:comparative:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ANKI_NOTE_TYPE: Basic
|
:ANKI_NOTE_TYPE: Basic
|
||||||
|
:ANKI_NOTE_ID: 1776793508124
|
||||||
:END:
|
:END:
|
||||||
** Front
|
** Front
|
||||||
Where is the data stored for ~std::array<int,26>~ vs ~std::vector<int>(26)~?
|
Where is the data stored for ~std::array<int,26>~ vs ~std::vector<int>(26)~?
|
||||||
@@ -61,6 +65,7 @@ Rule: use ~std::array~ when size is known at compile time (fast, no alloc). Use
|
|||||||
* Why const in const T& parameter :cpp:references:elaborative-why:
|
* Why const in const T& parameter :cpp:references:elaborative-why:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ANKI_NOTE_TYPE: Basic
|
:ANKI_NOTE_TYPE: Basic
|
||||||
|
:ANKI_NOTE_ID: 1776793508119
|
||||||
:END:
|
:END:
|
||||||
** Front
|
** Front
|
||||||
Why write ~const std::string&~ instead of ~std::string&~ for a read-only parameter?
|
Why write ~const std::string&~ instead of ~std::string&~ for a read-only parameter?
|
||||||
@@ -79,6 +84,7 @@ calc(s); // ❌ without const
|
|||||||
* Why & instead of pass-by-value for string param :cpp:references:elaborative-why:
|
* Why & instead of pass-by-value for string param :cpp:references:elaborative-why:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ANKI_NOTE_TYPE: Basic
|
:ANKI_NOTE_TYPE: Basic
|
||||||
|
:ANKI_NOTE_ID: 1776793508114
|
||||||
:END:
|
:END:
|
||||||
** Front
|
** Front
|
||||||
Why pass ~std::string~ by reference (~const std::string&~) instead of by value?
|
Why pass ~std::string~ by reference (~const std::string&~) instead of by value?
|
||||||
@@ -95,12 +101,13 @@ For a function that only reads, the copy is pure waste.
|
|||||||
* Reference vs pointer for function parameters :cpp:references:comparative:
|
* Reference vs pointer for function parameters :cpp:references:comparative:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ANKI_NOTE_TYPE: Basic
|
:ANKI_NOTE_TYPE: Basic
|
||||||
|
:ANKI_NOTE_ID: 1776793508109
|
||||||
:END:
|
:END:
|
||||||
** Front
|
** Front
|
||||||
When do you use ~T&~ vs ~T*~ for a function parameter?
|
When do you use ~T&~ vs ~T*~ for a function parameter?
|
||||||
** Back
|
** Back
|
||||||
| Feature | Reference ~T&~ | Pointer ~T*~ |
|
| Feature | Reference ~T&~ | Pointer ~T*~ |
|
||||||
|-------------------+----------------+--------------------|
|
|-------------------+--------------+------------|
|
||||||
| Can be null | No | Yes |
|
| Can be null | No | Yes |
|
||||||
| Dereference | ~str[i]~ | ~(*str)[i]~ |
|
| Dereference | ~str[i]~ | ~(*str)[i]~ |
|
||||||
| Can be reassigned | No | Yes |
|
| Can be reassigned | No | Yes |
|
||||||
@@ -110,6 +117,7 @@ Use ~T*~ when null is a valid input. Use ~T&~ when the value is *guaranteed to e
|
|||||||
* Rule of thumb: C++ function parameter types :cpp:references:factual:
|
* Rule of thumb: C++ function parameter types :cpp:references:factual:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ANKI_NOTE_TYPE: Basic
|
:ANKI_NOTE_TYPE: Basic
|
||||||
|
:ANKI_NOTE_ID: 1776793508102
|
||||||
:END:
|
:END:
|
||||||
** Front
|
** Front
|
||||||
What's the general rule for choosing parameter types in C++ functions?
|
What's the general rule for choosing parameter types in C++ functions?
|
||||||
|
|||||||
Reference in New Issue
Block a user