ylliX - Online Advertising Network

Using DuckDB C API to append Array type

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 […]

Can std::ranges::enumerate enumerate any possible valid C++ array?

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 […]

How is an Array like a Banana?

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 […]