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.

In an Delphi 64 bit application the keyboard stops working

15 May 2026 @ 8:50 am

I am out of luck finding the problem here, but it is important to solve. In a big Delphi project. There are some non-modal dialogs holding many input fields. When generating a 32-bit application, all works fine. Now the project needs to make a switch to 64-bit. When generating the 64-bit application, at first everything works fine, but while navigating through the input fields, the keyboard suddenly stops working. The keydown event is not firing anymore, and most keystrokes do not work. Tab seems to work all the time. This can be solved partly by opening Notepad and typing a character in the Notepad window and then switching back to the application. The problem occurs more often in VM environments or Remote-Desktop settings than on the local system. I did find some timing problems with events causing the menu bar to get focus. But I already addressed that. Did anyone ever experience something similar?

Apache ProxyPass for SPA download URLs — request from email link hits backend without auth header and 401s

15 May 2026 @ 8:36 am

Setup Migrated from mod_auth_openidc to SPA CIDP using angular-auth-oidc-client Angular SPA served by Apache. Backend is internal (not publicly reachable); Apache proxies /api/* to it. Backend requires Authorization: Bearer .... Without it: 401. Current vhost (relevant part) apache <Location ~ "^/api/reports.*"> Require all granted ProxyPass http://reports connectiontimeout=300 timeout=300 ProxyPassReverse http://reports ProxyPassReverseCookiePath / /reports <If "%{REQUEST_URI} =~ /download/"> ProxyErrorOverride on ErrorDocument 401 /error-401 </If> </Location> This works correctly for requests made by the SPA: HttpClient attaches the Bearer token via an interceptor, the <Location> proxies the request through, and the backe

Rust embassy-stm32 missing peripheral

15 May 2026 @ 8:25 am

I tried to setup a project with empbassy-stm32 for a STM32C011F6 microcontroller, but the definition for TIM3 is missing from the generated PAC. For embassy project generation I used cargo-embassy and embassy-template as mentioned in the documentation, but both generates the same. For cargo-embassy I noticed there's a correctly generated embassy-stm32 in the build artifacts, but the project uses a different one (ends with different hash) I also tried using the embassy examples, with the same result. In https://github.com/embassy-rs/stm32-data-generated/tree/main I see that for C0 with TIMER I should use v3, but I don't see any feature flag to set. What am I missing?

Flutter iOS draft images disappear after reopening draft on beta build only

15 May 2026 @ 8:20 am

I have a Flutter diary app with a "draft diary" feature that saves data locally. The issue is: Users can create a draft with images attached. After leaving the draft and reopening it later, the images are missing. This only happens on the beta build on ONE tester's iPhone 12. The same tester does NOT have this issue on the production build. Other devices seem fine. When checking logs: On the problematic beta build, image paths are stored under the Documents directory. On normal devices/builds, images are stored under the tmp directory. the log here The app currently saves image paths from the picker and restores them later for draft display.

Migrating VisualWorks/Visual Studio Smalltalk application to Java Spring Boot – approach and feasibility?

15 May 2026 @ 8:02 am

We are currently exploring options to modernize a legacy application built using Visual Smalltalk ( Vast Platform v12.0.1x86 Smalltalk) Enterprise) by migrating it to a Java Spring Boot architecture. As part of this effort, we are trying to understand best practices, tooling options, and real-world experiences for such migrations. ✅ Context Legacy system built in Visual Smalltalk Moderate-to-large codebase (business logic-heavy) Target platform: Java 17 + Spring Boot (microservices-oriented) Likely integration points: REST APIs Database persistence (JPA/Hibernate) External services ✅ Key Questions Conversion Strategy Is there any AI tool which could convert the entire code base from small talk to Java spring boot application Has anyone successfully migrated Visual Smalltalk to Java/Spring Boot? What approach worked best:

Why are these OpenCL call timings so noisy?

15 May 2026 @ 7:39 am

I'm running a simple OpenCL performance test on Radxa Dragon Q6A with Adreno 643 running Ubuntu 24.04.4 aarch64. These are the OpenCL platforms available: (.venv) rock@radxa-dragon-q6a:~/bench$ clinfo -l clinfo: /lib/aarch64-linux-gnu/libOpenCL.so.1: no version information available (required by clinfo) Platform #0: QUALCOMM Snapdragon(TM) `-- Device #0: QUALCOMM Adreno(TM) 635 Platform #1: rusticl `-- Device #0: FD643 and my Python 3.14.5 test script: import numpy as np, pyopencl as cl, os, argparse from time import perf_counter parser = argparse.ArgumentParser() parser.add_argument('-p', '--platform', default='0') os.environ['PYOPENCL_CTX'] = parser.parse_args().platform rng = np.random.default_rng() ctx = cl.create_some_context() queue = cl.CommandQueue(ctx) mf = cl.mem_flags prg = cl.Program(ctx, """ __kernel void sum( __global const

Preserve inner span tags when splitting text onto multiple lines

15 May 2026 @ 7:18 am

I am attempting to build a parallax banner. The banner will contain a short text sentence that wraps onto multiple lines. But I need each line to perform individual animation. So my objective is to split the text onto however many lines is required to accommodate the width of the parent container. This container will change width depending on the screen size. I also need to update the results if the screen size changes - for example if a tablet is rotated. So to summarise, if I have a paragraph in my parallax that says: <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque fermentum sem magna, vitae pharetra neque</p> I would want the results to output something like the below, with each span containing the maximum amount of words that can fit on one line: <p> <span>Lorem ipsum dolor sit amet, consectetur</sp

Azure Mistral OCR API does not support confidence_scores_granularity parameter

15 May 2026 @ 6:01 am

I am currently integrating the Azure-hosted Mistral OCR API endpoint I would like to retrieve OCR confidence scores (especially word-level confidence), similar to the native Mistral OCR API functionality in url https://docs.mistral.ai/studio-api/document-processing/basic_ocr?tab=confidence-scores-example#explorer-tabs-confidence-scores However, when sending the following parameter: { "confidence_scores_granularity": "word" } the API returns HTTP 422 with this error: { "error": { "code": "Invalid input", "message": { "detail": [ { "type": "extra_forbidden", "loc": [ "body", "con

How can I export a PDF file from Laravel application data?

15 May 2026 @ 4:44 am

I’m working on a Laravel application where I need to generate and export a PDF file based on database records (such as appointments, payments, or invoices). I want to be able to: Generate a PDF from a Blade view or data from the database Download the PDF directly in the browser Optionally store the generated PDF on the server I’ve seen packages like DomPDF and Snappy, but I’m not sure which approach is best or how to properly implement it in Laravel. For example, I have an Appointment model with related Payment data, and I want to export an invoice/receipt as a PDF. I looked into barryvdh/laravel-dompdf, but I’m unsure how to structure the controller and pass relational data properly. What is the recommended way to generate and export PDF files in Laravel, and could someone provide a simple example of implementation?

How do I display an ImageIcon from an image file in the high-resolution of today's screens?

15 May 2026 @ 1:20 am

I'm trying to read an icon from a .png file and display it at half size, to take advantage of the higher resolution of today's screens. But nothing I'm trying works. Here's what I've tried: In the image below, to create "32 scaled to 16," I called imageIcon.getImage().getScaledInstance(16, 16, Image.SCALE_SMOOTH) This method was written long before high-res screens were invented, and returns a low-res image at half size. To create "16-pixel variant," I created a MultiResolutionImage with 16-pixel and 32 pixel variants, and called multiResImage.getResolutionVariant(16, 16) which asks for the 16 pixel variant, hoping it would scale the 32 pixel variant down. It did use the 32-pixel variant, but at full size. This makes me wonder what that class is good for. To create "Half Size Button," I created a half-size subclass of ImageIcon, and overrode the three methods used to draw