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.

OpenMP schedule(dynamic) fails in RcppEigen on macOS Sequoia 15.6.1 (symbol not found in flat namespace)

4 December 2025 @ 3:57 am

I am running a straightforward parallelized computation using RcppEigen and OpenMP. Here is a minimal reproducible example of the code: // [[Rcpp::depends(RcppEigen)]] // [[Rcpp::plugins(openmp)]] #include <RcppEigen.h> #ifdef _OPENMP #include <omp.h> #endif Eigen::VectorXd test(const unsigned int& nthreads) { Eigen::VectorXd out(100); #ifdef _OPENMP omp_set_num_threads(nthreads); #endif #pragma omp parallel for schedule(dynamic, 1) for (int m = 0; m < 100; ++m) { out(m) = m; } return out; } When I try to compile this file with sourceCpp(), I get the following error: Error in dyn.load("/private/var/folders/wd/q0l84k7j0550fyqpqbgbrwjm0000gn/T/Rtmpva4klW/sourceCpp-aarch64-apple-darwin20-1.1.0/sourcecpp_1dc4c925a03/sourceCpp_4.so") : unable to load shared object '/private/var/folders/wd/q0l84k7j0550fyqpqbgbrwjm0000gn/T/Rt

How to fix bad animation when update UIView height from taller to smaller size in swift XIB?

4 December 2025 @ 3:24 am

Hello currently i'm facing bad behavior when update my bottomsheetview from taller size to smaller size. When it comes from smaller to taller size, the animation works well. But on the reverse condition, the behavior become the height shrink upward not downward like the video below I've set the bottomview.bottom to superview.bottom equals 0, but why when the height set to smaller size, it's going upward (not the top part going down)? design result XIB Bottom Part should be right The way resize the content extension BottomSheetViewController: ConfirmationDelegateBottom { public func resize(height: buttomHeightType){ contentViewHeight.constant = height.value

How to properly structure an aggregation pipeline builder for a product catalog (filters, sorting, pagination, min/max price)?

4 December 2025 @ 3:14 am

I’m building a product catalog API using MongoDB’s aggregation pipeline. On the Node.js side I have a TypeScript “builder” that dynamically constructs the pipeline based on filters, sorting, and pagination. The general model looks like this: category: ObjectId[] brand: ObjectId thumbnail: ObjectId gallery: ObjectId[] attributes: [{ attribute, unit, value, blockType }] pricing fields (priceRegular, priceSale) stock, analytics.*, etc. Right now the builder does something like this (simplified): public build(): any[] { const pipeline = [] pipeline.push(...this.buildBaseMatchByCategory()) // $match categories pipeline.push(...BASE_PIPELINE_BEFORE_FILTERS) pipeline.push(...this.addBaseFields())

How do I disable the annoying AI assist feature? [migrated]

4 December 2025 @ 3:09 am

Stack overflow has deployed a mandatory AI assist feature at the top of their user experience. There is no way to hide it or disable it using stack overflow's settings. How, as a user of stack overflow, can I use ublock origin to remove this kind of toxic UX injection? Ideally in a way that is modular enough so if it spreads it will work elsewhere. Or is there a more pure JS way to solve this problem?

iOS 26 Spacer doesn't work in keyboard toolbar when the item's size has infinite repeating decimals

4 December 2025 @ 2:51 am

I need to layout a few text & image buttons on keyboard toolbar, and want to insert spacers to evenly lay them out. For image button, I notice that if the size contains infinite repeating decimals (e.g. .666666..., then the spacer doesn't work. For example: public var body: some View { // Spacers don't work let width: CGFloat = 18.0 + (2.0 / 3.0) let height: CGFloat = 26.0 + (2.0 / 3.0) Image(uiImage: uiImage) .renderingMode(.template) .frame(width: width, height: height) } See picture: enter image description here However, if I round the numbers, it works: // this works .frame(width: width.rounded(), height: height.rounded()) I suspect this has nothing to do with infinite repeating decimals, because CGFloat is binary, so it cannot represent 2/3 accurately. So out of

AWS S3 pre-signed URL upload is returning 200 OK but the file never appeared in the bucket

4 December 2025 @ 1:29 am

Using Node.js and Express.js, I am generating an AWS S3 pre-signed upload URL.The request to S3 returns 200 OK but the uploaded file file never appeared in the bucket. There is no error in AWS console. server.js import express from "express"; import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3"; import { getSignedUrl } from "@aws-sdk/s3-request-presigner"; const app = express(); const s3 = new S3Client({ region: "ap-south-1", credentials: { accessKeyId: process.env.AWS_KEY, secretAccessKey: process.env.AWS_SECRET } }); app.get("/presign", async (req, res) => { const command = new PutObjectCommand({ Bucket: process.env.BUCKET_NAME, Key: "test-image.png", ContentType: "image/png" }); const url = await getSignedUrl(s3, command, { expiresIn: 60 }); return res.json({ url }); }); app.listen(3000, () => console.l

Lost access to my 2FA device – need reset

3 December 2025 @ 7:39 pm

I have lost access to my two-factor authentication (2FA) device and I cannot log in to my Heroku account. I no longer have the code or backup codes. Help me reset or disable 2FA on my account so that I can access it again.

Parsed CSV rows are coming through as Buffers instead of arrays when loading files from S3

3 December 2025 @ 2:45 pm

I'm pulling multiple CSV files from S3. Each CSV contains several rows in this format: 45,ABC,800046,HJN,9000 The first column is the employee ID. I want to loop through all the files, parse each CSV, and filter rows where the employee ID matches a given list (e.g., [118, 675]). However, when I log the parsed rows, they are still coming through as a Buffer instead of arrays of CSV fields. Here is the relevant part of my code: function filterCsvRows(allCsvBuffers, employeeIds) { let resultRows = []; for (const { key, buffer } of allCsvBuffers) { const csvText = buffer.toString("utf8"); const rows = parse(csvText, { columns: false, skip_empty_lines: true, trim: true, delimiter: ",", }); console.log("Parsed rows:", rows); // <-- This still logs Buffer } return resultRows; } And I'm collecting the S3 objects like th

can't connect my phone to debug my Android app in Android Studio on my Chromebook

3 December 2025 @ 2:28 pm

I'm having trouble debugging an Android app on a physical device using Android Studio on my Chromebook. My Setup: Device: HP Dragonfly Chromebook Plus (i7 13th Gen, 32GB RAM, SSD, 13" Touch). OS: ChromeOS (Up to date). Target Device: Huawei Mate 20 Pro (Android 12). The Issue: I am unable to see my phone in the 'Available Devices' list in Android Studio, even though: Cable is verified: The USB-C cable is data-capable (tested and working on my Ubuntu PC and Windows laptop). Connection mode: The phone is set to 'File Transfer' mode. ChromeOS recognition: The phone shows as 'Connected' in the ChromeOS settings (Connected Devices section). Settings: USB Debugging is enabled on the phone, and 'ADB Debugging' is enabled in the Chromebook's Linux Environment settings. Despite working perfectly on my Ubuntu machine and my Windows machine, Android Studio on the Chromebook simply won't list the device."

.NET auto Postman collection update

3 December 2025 @ 8:16 am

I always add new endpoints, and I manually add these endpoints one by one into Postman. This takes a lot of our time and sometimes gets forgotten. I want to automate this so that when the project runs, the new endpoints are automatically added to Postman. There are libraries that do this in PHP. How can I achieve this in .NET? But please don't suggest Swagger or similar tools. Thank you.