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.

OpenSAML Signing with Azure Key Vault using Azure's KeyVaultJcaProvider : engineInitSign() not supported

12 January 2026 @ 3:17 am

I am attempting to sign the OpenSAML response using Azure KeyVault but the default keyvault behaviour does not allow me to sign the payload because KeyVaultJcaProvider has KeyVaultKeylessRsa256Signature for the "SHA256withRSA" signature. There are no straightforward ways to overwrite this behaviour in KeyVaultJcaProvider Ideally, i want to set the service with following, so that OpenSAML Signer uses RSASignature without using KeyVaultKeylessRsa256Signature, but there is no way I found to enforce this. "Signature.SHA256withRSA", "sun.security.rsa.RSASignature$SHA256withRSA" Alternatively, is there a simpler way to sign a SAML with OpenSAML by passing the JCAProvider? I have the following in my code : Application.java > Security.insertProviderAt(new KeyVaultJcaProvider(), 1); // working as expected SpringApplication.run(Application.

JSON data into Mysql using PHP

12 January 2026 @ 2:54 am

Have a very large JSON dump file from a vendor of my golf stats for 2025. Trying to get it inserted into Mysql using PHP. The data seems to be multi-leveled. I have tried a number of snippets that I've found on StackOverflow and other places, but the format my data is in doesn't quite match what the articles I've found. { "rounds": [ "share_id": "h7ERkA", "started_at": "2021-06-06 16:03:55 UTC", "ended_at": "2021-06-06 20:50:05 UTC", "input_mode": "simple", "scoring_mode": "stroke_play", "course": { "name": "WinterStone Golf Course (18)" }, "tee": { "name": "white" } ] } The snippet of code that I found to try and parse the file and insert the data into a mysql database

certain pods resolving everything to 15.197.172.60

12 January 2026 @ 2:45 am

I have several k3s clusters, one is misbehaving, wherein argocd was warning of not being able to contact github.com, upon investifation I found that all hostnames were being resolved to: 15.197.172.60 which resovles to some amazon eaccelerator: dig -x 15.197.172.60 +short a63452c77db78f54b.awsglobalaccelerator.com. for example I try openssl on my nginx-ingress: k exec -n ingress-nginx ingress-nginx-controller-56cc7c9475-skb8d -it -- openssl s_client -connect apple.com:443 -servername apple.com \\Connecting to 15.197.172.60 CONNECTED(00000003) 289B45D0DF7F0000:error:0A000458:SSL routines:ssl3_read_bytes:tlsv1 unrecognized name:ssl/record/rec_layer_s3.c:916:SSL alert number 112 --- no peer certificate available --- No client certificate CA names sent Negotiated TLS1.3 group: <NULL> --- SSL handshake has read 7 bytes and written 1542 bytes Verification: OK --- New, (NONE), Cipher is (NONE) Protocol: TLSv1.3 This TLS version f

Issues with deleting File Search Stores and indexed documents

12 January 2026 @ 2:43 am

I’m currently working on a project using the Google Gemini File Search API. While most functions—such as creating stores, uploading documents, and generating RAG-based answers—work smoothly, I’n encountering significant performance issues and errors when managing a large volume of indexed documents (over 1,000 files). I would like to seek advice on the following two issues: 1. Performance bottleneck in locating and deleting specific files The current API doesn’t seem to support filtering the document list by ID or filename within a File Search Store. To delete a specific file, I have to fetch the entire paginated list and iterate through it, which is extremely slow when the store contains many documents. Is there a more efficient way to target and delete a single file without listing everything? 2. 503 Service Unavailable error when deleting a File Search Store When I try to delete an entire File Search Store th

Title: Project: Messaging Layer over DNS - Feasible or interesting? [closed]

12 January 2026 @ 2:21 am

"Hi, I'm a self-taught developer/entrepreneur. I'm exploring an alternative architecture for basic messaging that can operate under suboptimal conditions. Core concept: Leveraging existing and universally accessible protocols (like DNS) to create a minimal text messaging layer, without relying on expensive centralized infrastructure. Context: I come from an environment with frequent internet outages and high data costs, so I'm looking for smart, low-tech solutions. Specific questions for the community: 1. Are there any similar open-source projects I could study? 2. From a technical perspective, what are the main obstacles you see? 3. Is anyone with experience in network protocols interested in discussing possibilities? My motivation: Democratizing access to basic digital communication where it's needed most."

dbSendQuery fetches all rows when querying DuckDB

12 January 2026 @ 2:16 am

I tried to process some data in DuckDB from R in batches using the following approach: rs <- dbSendQuery(con, "select * from big_table;") while (!dbHasCompleted(rs)) { x <- dbFetchRows(rs, n = 1e5) ... } dbClearResult(rs) I noticed this was using way more memory than I was expecting before realizing the result set, rs, had the entire contents of big_table buried inside it as rs@env$resultset. I thought perhaps this was a DuckDB limitation, but I checked and confirmed this doesn't happen using the same database from Python using fetchone and the like. Is there perhaps some sort of setting I missed that is causing this behaviour in R, or is this just how things are implemented for now?

How to convert millimeters to centimeters in JavaScript without floating-point issues?

12 January 2026 @ 1:34 am

I'm working on a small frontend utility that needs to convert millimeters to centimeters. The basic formula is simple (cm = mm / 10), but I'm seeing floating-point precision issues in some cases, for example: 12.3 mm -> 1.2299999999999998 cm What is a clean and reliable way to handle this in JavaScript?

242. Valid Anagram - i don't know what's the wrong i doing here? [closed]

11 January 2026 @ 7:59 pm

this is the testcase failed : s = "aacc" and t = "ccac" expected : false but output : true here is my code : class Solution { public: bool isAnagram(string s, string t) { if(s.length() != t.length()) return false; unordered_map<char,int> mpp1; unordered_map<char,int> mpp2; for(int i = 0; i < s.length(); i++ ){ if(mpp1.find(s[i]) != mpp1.end()){ mpp1[s[i]] = 1; }else if(mpp1.find(s[i]) == mpp1.end()){ mpp1[s[i]]++; } if(mpp2.find(t[i]) != mpp2.end()){ mpp2[t[i]] = 1; }else{ mpp2[t[i]]++; } } return mpp1 == mpp2; } }; i now this may not be the correct way to writing this answer even with hash map as this by looking at this i feel their is something wrong , but i still try to code . what you guys think the prob

Why does std::print segfaults when using a string parameter?

11 January 2026 @ 2:43 pm

Consider the following code: #include <print> int main() { std::println("hello from {}", "me"); return 0; } On x86-64 this outputs hello from me. But on ARM64 it segfaults. ASM generation compiler returned: 0 Execution build compiler returned: 0 Program returned: 135 Program terminated with signal: SIGBUS If I make the string parameter permanent by putting it in a constexpr, the same error happens: #include <print> int main() { static constexpr auto name = "me"; std::println("hello from {}", name); return 0; } I'm using ARM64 gcc trunk with --std=c++23. The godbolt link to reproduce is here: https://godbolt.org/z/ss7xq87rG How do I pass strings as parameters to the st

Python Wait time for an animation in Pyqt5

11 January 2026 @ 3:13 am

I need a way to make a function that can make the code wait for a desired amount of seconds for an animation to play. This needs to be compatible with Pyqt5 and it shouldn't make the whole code stop; only the loop it is in will stop. While the wait runs in the desired loop, the rest of the code should run. Any Suggestions? def wait_tim(timed): counter = 0 done = False while not done: time.sleep(1) counter += 1 if counter > timed: break def wait_time(timedd): threading.Thread(target= wait_tim, args=(timedd)).start()