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.

Rust for loop IntoIterator::into_iter(values) vs values.into_iter()

24 April 2026 @ 9:23 am

While reading for-loops-and-intoiterator I understood how rust desugars a for loop, so far so good. I started playing around with it and decided to use &mut for values instead and saw the following let values = &mut vec![1., 2., 3., 4., 5.]; { let result = match IntoIterator::into_iter(values) { // values moved here mut iter => loop { let next; match iter.next() { Some(val) => next = val, None => break, }; let x = next; let () = { println!("{x}"); }; }, }; result } println!("{values:?}"); // BOOM: borrow of moved value let values = &mut vec![1., 2., 3., 4., 5.]; // let mut values = vec![1., 2., 3., 4., 5.]; { let result = match values.into_iter(

Mismatch Status Subscription antara Login Account dan Store Account (Firebase + RevenueCat)

24 April 2026 @ 9:23 am

Saya sedang mengembangkan fitur subscription menggunakan Firebase Authentication untuk login dan RevenueCat untuk menangani in-app purchase. Masalah muncul ketika user menggunakan akun login yang berbeda dengan akun store (Google Play atau App Store) di device mereka. Dalam kasus yang saya alami, user login menggunakan akun A yang statusnya masih free, tetapi device tersebut menggunakan akun Google Play atau App Store B yang sudah memiliki subscription aktif (Professional). Ketika user A mencoba upgrade ke Professional, sistem justru langsung membaca bahwa subscription sudah aktif, sehingga user A dianggap sudah berstatus Professional padahal sebenarnya belum pernah melakukan pembelian di akun tersebut. Dari yang saya pahami, hal ini terjadi karena RevenueCat membaca status subscription berdasarkan akun store, sementara aplikasi saya menggunakan Firebase user sebagai identitas utama. Akibatnya terjadi ketidaksinkronan antara ownership subscription dan akun login yang digunaka

How To Create Dynamic Word File In Power Automate

24 April 2026 @ 9:21 am

I am building an agent in Power Automate that translates a user-provided document into a requested language and returns it as a Word document. The input documents can contain dynamic content like tables, bulleted lists, and varying text structures. While the agent successfully translates the content, I am struggling with the final step: generating the final Word document flexibly so that it retains a proper structure. I tried saving the translated text as an HTML file and then converting/saving it as a Word document (.docx). However, this seems to break the file structure; Microsoft Word throws an error and refuses to open the generated file. "Populate a Microsoft Word template" action: I tried the native Word Online connector. Unfortunately, this tool is too rigid for my use case. It requires a fixed, static template and doesn't handle highly dynamic layouts (like an unpredictable number of tables, bullet points, or varying document lengths) well.

Re-inserting references to System.Windows.Forms in Visual Studio

24 April 2026 @ 9:10 am

I had problems with conflicting packages in my project, so I decided to create a new project and copy the source files into the new project, then downloading the relevant packages with nuget. Now I miss references to System.Windows.Forms and others. The Using directives are grayed out, and e.g. MenuItem is not available. Using directives grayed out error message By right-clicking Dependencies in the Solution Explorer, I can add project references, but I don't have anything to select from. How can I automatically get or manually set the references to these?

WebAPI in blazor: no such host is known

24 April 2026 @ 9:09 am

I've added some webAPI controllers to my Blazor server project. They work when called directly from the browser, but when I use HttpClient in the Blazor client side project I get HttpRequestException: No such host is known. What's going on? Steps to reproduce: Create a new Blazor app. Add a controller to the server side app: [Route("api/[controller]")] [ApiController] public class ValuesController : ControllerBase { [HttpGet("")] [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] public IActionResult Get() { return Ok("Now is the time for all good men to come to the aid of the party."); } } and route it in: public static void Main(string[] args) { var builder = WebApplication.CreateBuilder(args); /

Docker Frigate container not able to use Intel iGPU - after a container restart

24 April 2026 @ 9:09 am

Whenever I restart my host machine and the Frigate Docker container starts up automatically, the container can use the iGPU for AI detection perfectly, and I see load on the Render/3D part of the intel_gpu_top command. However, when I only restart the container and not the entire machine, I get a map::at error from OpenVINO. Which is really annoying. For now, I think it is a state issue, for example a lock not being released on the iGPU or something, because I've looked at the iGPU state and nothing seems wrong, it's not entering a deep sleep state, it does say gpu state: idle, but I still see load on intel_gpu_top so I assume that's not a problem. I have already set kernel params to disable rc6 and disable most low power states. So I am convinced it's a Docker iGPU passthrough problem. /dev/dri/renderD128 (Intel iGPU) is visible inside the container, Frigate still returns the map::at

What are the best methods or libraries to extract Arabic text from images or PDFs without using Surya OCR?

24 April 2026 @ 9:09 am

I am working on a project where I need to extract Arabic text from images and PDF documents. Currently, I am using Surya OCR, but I would like to explore other alternatives that might provide better accuracy or easier integration. The main challenge is handling Arabic text correctly, including right-to-left writing, special characters, and diacritics. I am looking for tools, libraries, or models that support Arabic OCR and can be used locally or with Python. What are the best options available, and which ones give the most accurate results for Arabic text extraction?

Custom Search JSON API returns 403 "This project does not have the access" despite API enabled and billing linked

24 April 2026 @ 8:59 am

I'm getting a persistent 403 error with the Google Custom Search JSON API despite having everything configured correctly. The error message is: "This project does not have the access to Custom Search JSON API" with status PERMISSION_DENIED. My setup: API is enabled in Google Cloud Console, billing account is linked, API key has no restrictions, and I have a valid Programmable Search Engine CX ID. What's strange is that the quota dashboard shows my requests ARE being counted (9 requests recorded), but they all return 403. I tested across 2 different Google Cloud projects, 2 different API keys, and 2 different IP addresses (a Hetzner server in Germany and a local Windows machine in France). Same error every time. Has anyone seen this kind of account-level block on Custom Search API? Is there an additional activation step I'm missing?

How to remove email address from an Azure AD account that no longer has Exchange licence

24 April 2026 @ 8:44 am

I have an Azure AD (MS Entra - no on-prem) user account that does not have an Exchange licence, but has had an email address set up. I want to use this "upn" (which is set as the email address too, as you would expect) as an ALIAS on another user account to receive incoming email. However if I try to add the email address to the other user, I get an error saying another user (gives upn) is already using this email address. But it is not, as it is not licenced! In Azure AD for the original user, I can see the "email" property does indeed still hold the "email address" I am trying to use for alias addressing. If I try to blank the "email" property field I get this error, and cannot save the user record: Invalid value specified for property 'mail' of resource 'user' I am guessing that somewhere (possibly in Exchange) there is part of a record left over, that needs t

How to change spray color during painting process in visual components via a Python script?

24 April 2026 @ 8:23 am

I'm currently creating a painting simulation in visual components where I adapt most process parameters via Python. I also want to change the paint color during the simulation. Unfortunately I'm still a novice, and I'm struggling to find the right approach. The paint color is changed inside a separate paint tab via the coating thickness. In these settings I don't see any interface to other components like a signal that I can connect to my script, therefore I don't know how to access these settings in my code. My tries so far: I wrote a script where I change the volume flow of the paint. Different paint thicknesses then correspond to different colors. Unfortunately it's not viable in the long run. I tried to layer very small, colored objects via raycasting, but I'm at a loss as to how to successfully implement this.