I’m trying to make a class to create a normal shape (equilateral shape) using OpenGL on Mac. The given parameters are a center coordinate (double center[2]), a radius from center to a vertex (double radius), and a number of sides (int sides). Here’s the code: #include “../vendors/GLFW/glfw3.h” #include <cmath> class EquilateralShape { public: int sides; […]
I have an existing DuckDB database with a table that has the schema: name: VARCHAR location: VARCHAR lucky_numbers: UINTEGER[5] and I want to add a row using DuckDB’s C API. // .. already connected to database duckdb_appender appender; duckdb_appender_create(db_connection, NULL, db_table, &appender); duckdb_append_varchar(appender, “John Doe”); duckdb_append_varchar(appender, “Switzerland”); // TODO: append an Array of of 5 […]
Once I asked whether std::ranges::views::enumerate uses the wrong type (long) for indexing on GCC, but apparently that’s not the case, because std::views::enumerate is specified to use range_difference_t<Base> as its index value. However, from the draft The type size_t is an implementation-defined unsigned integer type that is large enough to contain the size in bytes of […]
Some time ago, poor Keith found himself working on an antique Classic ASP codebase. Classic ASP uses VBScript, which is like VisualBasic 6.0, but worse in most ways. That’s not to say that VBScript code is automatically bad, but the language certainly doesn’t help you write clean code. In any case, the previous developer needed […]
I am working with extremely large numbers and would like to verify my Karatsuba multiplication result ((2^136279841)-1)^2 which needs (532 344 * _m256i_epi64)^2 i.e. 4,258,752 uint64_t to store the result. I stored all required data arrays in a preallocated memory: size_t num_bits = 136279841; size_t num_uint64 = (num_bits + 255) / 256 * 4; size_t […]