Random snippets of all sorts of code, mixed with a selection of help and advice.
Apache Camel Kafka Consumer: using the producer-only `metadataMaxAgeMs` option to force indefinite retries on failures — is this safe/intended?
18 June 2026 @ 7:58 pm
We have a requirement for our Camel Kafka consumer to keep retrying indefinitely when it hits a failure while connecting to the broker, instead of giving up. The only way we were able to get a true "retry forever" effect was by also setting metadataMaxAgeMs on the consumer endpoint — even though the Camel Kafka component docs listed metadataMaxAgeMs strictly under (producer) options, not consumer.
Currently using camel-kafka 4.x and spring-boot 3.x.
Config
We build the consumer URI dynamically and pass these (currently hard-coded, would move to config if this approach is validated):
public String getURI() {
int reconnectBackoffMaxMs = SpringContextLookupUtil.getSystemProperty(
"armada.kaf
SQLite: how to match multiple records from multiple many-to-many relations?
18 June 2026 @ 7:49 pm
I've got the below SQlite tables (simplified for posting here):
CREATE TABLE movies (movie_id, title);
INSERT INTO movies (movie_id, title) VALUES
(0, 'Shaun of the Dead'),
(1, 'Hot Fuzz'),
(2, 'The World''s End'),
(3, 'Attack The Block'),
(4, 'Star Trek');
CREATE TABLE actors (actor_id, name);
INSERT INTO actors (actor_id, name) VALUES
(0, 'Simon Pegg'),
(1, 'Nick Frost'),
(2, 'Bill Nighy'),
(3, 'Paddy Considine'),
(4, 'John Boyega'),
(5, 'Leonard Nimoy');
CREATE TABLE movie_actor_links (movie_id, actor_id);
INSERT INTO movie_actor_links (movie_id, actor_id) VALUES
(0, 0), (0, 1),
(1, 0), (1, 1), (1, 2),
(2, 0), (2, 1), (2, 3),
(3, 1), (3, 4),
(4, 0), (4, 5);
I wanted to get movies starring Simon Pegg and Nick Frost:
SELECT m.title
FROM movies m
INNER JOIN movie_actor_links mal ON mal.movie_id = m.movie_id
INNER JOIN actors a ON a.actor_id = mal.actor_id
WHERE a.name = 'Simon Pegg' OR a.name = 'Nick Frost'
GROUP BY m.movie_
Only load content when accordion is expanded - WordPress & Elementor
18 June 2026 @ 7:33 pm
I'm trying to clean up a client's page list by moving all of their forms (of which they have over 90, and all of them currently live on separate pages) into an accordion on one page using WordPress with Elementor's nested accordion widget. I've created the page and have added the following snippet to make the accordion open automatically when the item ID is appended to the URL:
<script>
jQuery(document).ready(function($) {
// Function to extract the hash, even when query parameters exist
function getHashFromUrl() {
var url = window.location.href;
var hashIndex = url.indexOf('#');
return hashIndex !== -1 ? url.substring(hashIndex) : ''; // Return hash if present
}
var hash = getHashFromUrl();
if (hash !== '') {
var accordionItem = $(hash);
if (accordionItem.length > 0) {
// Close the first accordion if it has the 'open' attribute
BigQuery Dataset Sharing with external user
18 June 2026 @ 7:29 pm
I have a bigquery dataset that I am trying to share with an external user. I go to dataset -> share -> manage permissions -> add principal. I add the user ID in the new principal and assign the BigQuery Data Viewer role. When I save, I receive the below error:
IAM policy update failed
You do not have permissions to update the policy. Please check you have a role that allows you to edit IAM permissions on the resource.
I have verified that my principal has bigquery admin and bigquery data owner role as well as analytics hub related roles. What could be other issue here?
C++ equivalence of Python code for HDF5. Writing/reading if the .h5 file exists and if not, then creating the .h5 file and writing/reading
18 June 2026 @ 4:55 pm
What is the C++ equivalence for the following Python code when working with HDF5:
import h5py
file_name = "f_1"
# ...
f = h5py.File(f"{file_name}.h5", "a")
# ...
C++ code, progress for now:
#include <array>
#include <vector>
#include "H5Cpp.h"
const H5std_string FILE_NAME("f_1.h5");
// ...
int main()
{
std::vector<std::array<int, 3>> a_2d{{1, 1, 1}, {2, 2, 2}, {3, 3, 3}, {4, 4, 4}}; // In Python: `l_2d = [[1, 1, 1], [2, 2, 2], [3, 3, 3], [4, 4, 4]]` (list-of-lists representing a function call that returns a list-of-lists with variable size)
try
{
Exception::dontPrint();
H5::H5File f(FILE_NAME, H5F_ACC_TRUNC);
// ...
}
catch (FileIException error)
{
error.printErrorStack();
return -1;
}
catch (DataSetIException error)
{
error.printErrorStack();
return -1;
}
catch (DataSpaceIException error)
Does Azure email you when your Golden Images need to be recompiled?
18 June 2026 @ 1:23 pm
I'm in the process of producing some Golden Images that I would like to bring to the Azure market place. If there are vulnerabilities found in Express or Node that gets patched and require a recompile of the Golden Image. Will Azure let you know trough an email what Golden Images need a recompile. I'm specifically wanting an email on the business account. I don't want to need to troll twitter accounts to know when Express and Node give problems.
Is there a setting you can set for auto updates of new found vulnerabilities that will send you an email?
IConfiguration.Get<>() not retrieving for elements with properties with empty arrays
17 June 2026 @ 7:55 pm
I'm trying to import my ServerProcessConfig[] from my appsettings.json. If I have an element in the array that has an empty array for Dependencies, it does not import the whole object for config.
Tried with and without the nullable.
using Microsoft.Extensions.Configuration;
var configuration = new ConfigurationBuilder()
.SetBasePath(AppContext.BaseDirectory)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.Build();
var servers = configuration
.GetSection("Servers")
.Get<List<ServerProcessConfig>>()!;
Console.WriteLine(servers.Count);
public sealed record ServerProcessConfig(
int Id,
int[]? Dependencies);
The following element in the Servers array is skipped and the number of server configs retrieved is 1. Tried with the empty array an
Which database programming language gives most efficiency with less data consumption?
17 June 2026 @ 6:39 pm
Regarding several databases used for storing large amount of data, which database programming language gives most efficiency with less data consumption?
I have used many database programming languages.
What are opinions and experience of using different databases for getting more efficient storage, fast, secure and less data consumption, and data storage capacity with more rate limiting and better sharing?
What are arguments for the best database for building schema for a large amount of data and with database architecture for large storage?
Selecting and returning a single cell from a grid from within the shell?
17 June 2026 @ 8:37 am
I'm running under Debian 13 linux.
Suppose I have a file with the following contents ...
A
B
C
D
E
F
G
I know how to use zenity and yad with the --list command-line argument to display this file's contents in a single vertical list box which will allow me to select any one of those items and return it to the shell for processing.
I also know how to use --column 2 on the command line to get the data to display in a 2-column grid as follows:
A B
C D
E F
G
... and I can select any row and return its contents to the shell.
However, what I'd like is to have the text displayed in such a grid, but to only return one single selected cell's data to the shell, not the entire row. For example, I'd like to be able to click on "E" and only have "E" returned to the shell. But when I click on "E" I always get the following re
C# style rules defined in .editorconfig are ignored in Razor code blocks
11 December 2025 @ 9:34 am
I am setting up an .editorconfig file to enforce certain conventions and code styles.
I have noticed that C# style rules only seem to apply to *.cs files and not Razor C# code blocks.
Take, as an example, this simple .editorconfig file:
root = true
# Default settings
[*]
csharp_prefer_braces = when_multiline:error
It works fine in a .cs file:
But it does not work in a @code block of a razor file:
Is this a known limitation? I am using Rider 2025.2.2.
But it does not work in a @code block of a razor file:
Is this a known limitation? I am using Rider 2025.2.2.