Random snippets of all sorts of code, mixed with a selection of help and advice.
Core Data relationships (constraints) not reflected in CloudKit schema – expected behavior or misconfiguration?
23 March 2026 @ 12:01 pm
I’m working on an iOS app using Core Data with CloudKit synchronization (NSPersistentCloudKitContainer).
In my Core Data model, I have defined relationships between entities (e.g. 1:n and n:m). These relationships and constraints are clearly set up in the .xcdatamodeld file.
However, after enabling CloudKit and letting the schema initialize in the iCloud container, I noticed that these constraints (relationships, cardinality, etc.) do not seem to be reflected in the CloudKit schema as I would expect.
From what I can see:
• The record types are created in CloudKit
• Fields are present
• But relationships and constraints are not represented in the same way as in Core Data
This leads me to a few questions:
1. Is it expected that Core Data relationship constraints are not explicitly mirrored in the CloudKit schema?
2. How does CloudKit internally handle relationships defined in Core Data?
3. Are developers expected to enforce these co
In Qmetry- I'm unable able to fetch (DELETE) with content-type:JSON
23 March 2026 @ 11:46 am
In QMetry, I am unable to perform a DELETE request using Content-Type: application/json. However, the same API works correctly for GET and POST requests with JSON. The DELETE operation succeeds only when Content-Type is set to multipart/form-data, not with JSON.
The step is I request api (API)
How to use structured references in Excel tables for better formula accuracy?
23 March 2026 @ 11:41 am
When instructed to append a total to the table in Excel, what action does Copilot take?
It adds a sum to the top of the last column.
It adds a sum to the bottom of the first column.
It adds a sum to the top of the first column.
It adds a sum to the bottom of the last column.
SQL recursive cte exit and return item where a descending table and a ascending formula meet
23 March 2026 @ 11:31 am
My intention is that I want the recursive bit to go down in values for the pc table and up in values for the plus_one recursive formula until the value in plus_one is greater than the one in pc and then return the plus_one value. Instead my code below enters an infinite loop.
create table pc
(
c integer not null
) strict;
create index ipc on pc ( c desc );
insert into pc(c) values (8);
insert into pc(c) values (6);
insert into pc(c) values (4);
insert into pc(c) values (2);
insert into pc(c) values (0);
with recursive meet_in_middle
(
cit,
plus_one
)
as
(
values
(
0x7FFFFFFFFFFFFFFF,
0
)
union all
select
pc.c as cit1,
meet_in_middle.plus_one + 1
from pc, meet_in_middle
where meet_in_middle.plus_one > cit1
)
select meet_in_middle.plus_one
from meet_in_middle;
Remove carriage return to ensure all lines start with specific word
23 March 2026 @ 11:26 am
I am trying to process a large log file generated from a script.
I would like to count the number of DMAs for each type of issues logged. Therefore I would like to reformat the log so all the lines start with the word DMA. Any ideas how I can use Regex in Notepad++ to do this?
Original text:
DMA: DTS030A - Subnetwork name not populated
DMA: DWD019 - Subnetwork name not populated
DMA: DTD012 {C9A805B2-58EF-442B-B6FC-BBF933E84AA1}
Invalid subnetwork connectivity
DMA: DTD012 {C5B8A4A9-410F-46CE-AE09-46EA8E11B2F4}
multiple subnetwork controllers
Expected output:
DMA: DTS030A - Subnetwork name not populated
DMA: DWD019 - Subnetwork name not populated
DMA: DTD012 {C9A805B2-58EF-442B-B6FC-BBF933E84AA1} Invalid subnetwork connectivity
DMA: DTD012 {C5B8A4A9-410F-46CE-AE09-46EA8E11B2F4} multiple subnetwork controllers
yfinance returning empty DataFrame/Error when fetching historical data in Python
23 March 2026 @ 11:23 am
I am trying to download historical stock data for Microsoft (MSFT) using the yfinance library, but I am not receiving the expected data. I have already tried upgrading the library to the latest version.
My Setup:
Python version: 3.11.3
yfinance version: 0.2.31
Operating System: Windows 10 pro
Code:
# Trying again to fetch data for microsoft(MSFT) using yfinance
df =yf.download("MSFT", start='2025-01-01', end='2025-02-01')
df.head()
The Issue: When I run the code above, I get the following result:
" Failed to get ticker 'MSFT' reason: Expecting value: line 1 column 1 (char 0)
[*********************100%%**********************] 1 of 1 completed
1 Failed download:
['MSFT']: Exception('%ticker%: No timezone found, symbol may be delisted') "
What I've tried:
Ran pip install --upgrade yfinance to ensure I'm on
Error 0x80092006 when signing .mst file in InstallShield
23 March 2026 @ 11:22 am
I am using InstallShield 2020 Premier R2.
I got the code signing certificate from DigiCert and use its KeyLocker to do the code signing.
In the past, I install everything on my WIndows 7 and InstallShield can sign .mst files properly.
Now I want to do the same thing on my new laptop with Windows 11 system. I have installed the certificate on the local computer. And Windows SDK sigetool can sign .EXE and .DLL files properly.
In my InstallShield project, I select the same certificate as the one on WIndows 7 in the "Signing" tab.
Everything on Windows 11 seems to be same as those on Windows 7. But when I built my InstallShield project, I get the following error:
Started signing 1025.mst ...
SigningHelper: error 0x80092006 while attempting to sign file
ISDEV : error -1027: Failed signing 1025.mst
How to fix the problem?
GCC vs Clang when packing array<uint8_t,N> into uint64_t
23 March 2026 @ 11:06 am
I have a hash table with the key type std::array<uint8_t,6>, and I am trying to come up with as fast hash function as possible. One option is to pack all six 8-bit integers into a single 64-bit integer first, and then just use std::hash<uint64_t>. I've tried two different ways how to resolve this packing, one based on casting and shifting, the second one based on memcpy.
uint64_t pack(std::array<uint8_t, 6> key) {
return
(static_cast<uint64_t>(key[0]) << 0)
| (static_cast<uint64_t>(key[1]) << 8)
| (static_cast<uint64_t>(key[2]) << 16)
| (static_cast<uint64_t>(key[3]) << 24)
| (static_cast<uint64_t>(key[4]) << 32)
| (static_cast<uint64_t>(key[5]) << 40);
}
uint64_t pack(std::array<uint8_t, 6> key)
HDLBits problem ece241_2014_q7a. Simulation of my solution is not correspondent with reference
23 March 2026 @ 10:53 am
Here is the original problem:
Design a 1-12 counter with the following inputs and outputs:
Reset Synchronous active-high reset that forces the counter to 1
Enable Set high for the counter to run
Clk Positive edge-triggered clock input
Q[3:0] The output of the counter
c_enable, c_load, c_d[3:0] Control signals going to the provided 4-bit counter, so correct operation can be verified.
You have the following components available:
the 4-bit binary counter (count4) below, which has Enable and synchronous parallel-load inputs (load has higher priority than enable). The count4 module is provided to you. Instantiate it in your circuit.
logic gates
How to implement a mutual watchdog (process pairing) in C++ on Windows without recursion?
23 March 2026 @ 10:27 am
Title: How to implement a mutual watchdog (process pairing) in C++ on Windows without recursion?
Body:
I am developing a Windows console application in C++ (using MSVC) and I want to implement a mutual watchdog system.
The Goal: I have two processes: MainApp.exe and Watchdog.exe.
If MainApp is closed or crashes, Watchdog should restart it.
If Watchdog is killed, MainApp should restart it.
The Problem: Currently, I am facing a "process recursion" issue. When MainApp starts, it launches Watchdog. Then Watchdog checks for MainApp, and if it doesn't correctly identify the existing parent process, it launches a new instance of MainApp, which launches a new W