Miscellaneous#

SQLite#

Formatting UNIX time in SQLite#

SELECT strftime("%F %R:%f", 1713213002.456, "unixepoch", "subsecond");

In SQLite, the strftime function formats the 2nd argument (time value) according the 1st argument (the format). The modifiers are from the 3rd argument onwards, "unixepoch" indicates that the time value shall be interpreted as UNIX epoch, and the "subsecond" modifiers indicates the time value has millisecond in it, hence the time value is a float instead of an int.

Algorithms#

O, Ω and Θ#

  • O is upper bound

  • Ω is lower bound

  • Θ is tight bound

CMake#

CMAKE_CURRENT_SOURCE_DIR vs CMAKE_CURRENT_LIST_DIR#

They differ when include is used. CMAKE_CURRENT_SOURCE_DIR will refer to the directory where include is called, whereas CMAKE_CURRENT_LIST_DIR will still refer to the location containing the CMake file being included.