StackOverflow.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (13 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

Include a subdirectory using Conan

18 January 2026 @ 11:33 pm

I want to solve a simple problem, that imply integration a subdirectory from include that have .hpp files, named mylib. In conanfile.py I doing looks as follow: class myapp Recipe(ConanFile): name = "myapp" version = "1.0" package_type = "application" # Binary configuration settings = "os", "compiler", "build_type", "arch" # Sources are located in the same place as this recipe, copy them to the recipe exports_sources = "CMakeLists.txt", "src/*", "include/*" def layout(self): cmake_layout(self) def generate(self): deps = CMakeDeps(self) deps.generate() tc = CMakeToolchain(self) tc.generate() def build(self): cmake = CMake(self) cmake.configure() cmake.build() def package(self): copy( self, pattern="*.hpp"

'_ReadWriteBarrier' : cannot be found in "wdm.h"

18 January 2026 @ 11:24 pm

I'm taking my first steps in kernel driver dev. So to make the install I followed the process given here: https://learn.microsoft.com/fr-fr/windows-hardware/drivers/download-the-wdk . However when trying to build a simple driver: #include <ntifs.h> NTSTATUS DriverEntry() { return STATUS_SUCCESS; } I have the following error: '_ReadWriteBarrier' : cannot be found in "wdm.h" Note that I created my project in Visual Studio 2022 as an empty Kernel Mode Driver. (It seems that maybe Visual Studio messed some config parameters because I had already some problems with target definition for nddk.h.) How can I fix this?

Data frame error when trying to create a direct acyclic graph using igraph and HYPOWEAVR functions on R - how to fix or better way to create DAGs?

18 January 2026 @ 10:58 pm

I'm trying to figure out how to create direct acyclic graphs (DAGs) using graph on R with models written as text pathways in Excel with a dataset that is still growing. I am doing a literature review on how an invasive species impacts native ecosystems and want to use the information that I pull from the various sources to create a giant DAG that looks like the last figure on this page (https://r.igraph.org/articles/igraph.html). Mine will have a lot more nodes and I want the lines between nodes different colours and thicknesses depending on whether the link was made using a paper that was studying my target species or not and if the links between nodes was made using experimental data or not. I have been trying to use the HYPOWEAVR code and process they describe to collate the data but have run into some code issues, and I want to create the plots with igraph after. From each paper I have read

`npm run` used within VS Code can't find an executable I have verified exists. Why not?

18 January 2026 @ 10:13 pm

Using VS Code on Linux Mint, I'm trying to npm run a bash script from within VS code, but I get an error; ls: cannot access '/usr/bin/convert': No such file or directory The terminal process "/usr/bin/bash '-l', '-c', 'npm run icons'" terminated with exit code: 2. My script works fine in a command terminal. More details below. I've come to the conclusion the command is running inside some container that doesn't have access to the host directories. So, how can I fix this? I've looked through the 25 similar posts to review before posting, and don't see an exact match. Though, I wonder if I might need a tasks.json file? DETAILS.... I've added the following to ~/.profile , guessing it's some kind of shell/path issue. I echo these within the script, and see they are as expected when the script runs. PATH="/usr/bin:$PATH" LD_LIBRARY_PATH="/lib:$LD_LI

How can I get a single data entry from a custom database table in WordPress?

18 January 2026 @ 8:43 pm

I'm quite new to SQL so I'm really struggling on this issue. I added a custom table to my database and I want to call on a particular row as defined by the ID and then display the string contents of another column in that row. The user makes a selection from a drop down box which assigns the ID and this is then queried using SQL. $industry = $_REQUEST['industry']; global $wpdb; $authority = $wpdb->get_var("SELECT authority FROM $wpdb->tbl_industries WHERE id=$industry"); echo "<p>$authority</p>"; $industry is the user selection, tbl_industries is the table name, id and industry are columns in the table. I'm not having much success. Does anyone know where I've gone wrong?

Does Move to/from Control Registers ignore the field mod?

18 January 2026 @ 6:34 pm

This has been re-asked as a proper non-opinion-based question, as Does Move to/from Control/Debug Registers ignore the field mod? This version should get deleted.

PyInstaller Icon File

18 January 2026 @ 5:55 pm

When I include my icon file using Pyinstaller, it compiles successfully but when I run the .EXE I get an exception stating the icon file cannot be found. If I remove the icon reference from my script, it both compiles and runs correctly but of course no icon. Why can't Pyinstaller resolve the dependency? I have tried moving it to different locations with the same result.

How to use copybooks for COBOL programm using CICS and DB2?

18 January 2026 @ 2:26 pm

I am learning COBOL, CICS, and DB2. To that end, I created a program that implements a pseudo-transactional CICS process and interacts with DB2. The transaction works quite well, but the program behind it is starting to get long. I would like to know how people usually manage to place paragraphs containing CICS statements (EXEC CICS ...), DB2 statements, or both, into copybooks and then reuse them. I have tried COPY, INCLUDE, and even ++INCLUDE, but none of them worked. Here is my JCL script for the preprocessing, compilation, and linking //COMPPRG JOB 'COMPGDB',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), // NOTIFY=&SYSUID //PLIB JCLLIB ORDER=(DFH510.CICS.SDFHPROC, // PROJECT.CICS.SOURCE, // PROJECT.CICS.LINK, // PROJECT.CICS.LOAD)

Storage duration of compound literals in C

17 January 2026 @ 8:07 pm

Compile and run the code below: #include <stdio.h> struct s { int *i; }; void f(struct s *foo, const int a, const int b) { foo->i = (int []){a, b}; } int main(void) { struct s foo = {0}; f(&foo, 34, 35); printf("%d\n", foo.i[0]); return 0; } with clang, no error/warning: % clang --version Apple clang version 17.0.0 (clang-1700.6.3.2) Target: arm64-apple-darwin24.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin % clang -Wall -Wextra -o main main.c && ./main 34 while gcc shown warning message as such: % gcc --version gcc (Homebrew GCC 15.2.0) 15.2.0 Copyright (C) 2025 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERC

Multiframe ZSTD file: how to jump to and stream the second file?

16 January 2026 @ 9:05 pm

I compress two ndjson files into a multiframe ZST file where each ndjson is compressed into a frame. I have the following metadata meta_data (as a list) of the ZST file: import zstandard as zstd from pathlib import Path input_file = r"E:\Personal projects\tmp\test.zst" input_file = Path(output_file) meta_data = [{'name' : 'chunk_0.ndjson', 'uncompressed_size' : 2147473321, 'compressed_offset' : 0, 'uncompressed_offset' : 0, 'compressed_size' : 175631248}, {'name' : 'chunk_1.ndjson', 'uncompressed_size' : 2147473321, 'compressed_offset' : 175631248, 'uncompressed_offset' : 2147473321, 'co