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.

Blazor SSR enhanced form inside a dialog

27 February 2026 @ 3:21 pm

I want to create a dialog that contains a form that gets updated with success message or errors after submit, but it should not automatically get closed nor should the page reload. The issue is that enhanced loading does not play nicely with dialogs and forms. I thought that Blazor would just update the form DOM and not touch the dialog outside the form, but after submit the dialog gets closed and the page becomes unresponsive (as if the modal was still open but invisible). As far as I understand, dialogs should not get automatically closed if the method is NOT dialog on the form, so I'm guessing the issue here is the enhanced loading... <dialog id="emailModal" class="modal modal-bottom sm:modal-middle"> <div class="modal-box"> <button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2" onclick="emailModal.cl

Recursive keypad combination not generating correct result in Python

27 February 2026 @ 3:09 pm

I am trying to implement a recursive function to generate keypad combinations (like old mobile keypad). d = { '1': "abc", '2': "def", '3': "ghi", '4': "jkl", '5': "mnop", '6': "qrst", '7': "uv", '8': "wxyz", '9': ".;", '0': "?!" } Here is my recursive function: def keypad_combination(d , s , result , indx): if indx == len(s): return result if len(result) == 0: result = result.extend(d[s[indx]]) else: for char in result: char += d[s[indx]] return keypad_combination(d,s,result, indx+1)

Plotly Choropleth Map: Data points not showing up randomly in the map

27 February 2026 @ 3:09 pm

I am trying to create an animated choropleth map using Plotly that shows when certain countries legalised a policy. So basically, the map is animated to show each year and countries are coloured different colours based on if they legalised a policy, banned it, or added some other condition to the policy. However, as the map progresses through the years, the data points for certain countries are not showing up correctly. Basically, my source data looks like the following image - Source data format And in my map, for some years, the legal status just disappears and the country becomes blank. This is the map. If you scroll to 1988 and watch it move to 1989, you will notice that USA goes blank. However, in the

Sitecore Docker CM and CD container not copying delta asset image over the Base Image

27 February 2026 @ 2:54 pm

We are upgrading Sitecore from 10.4 to 10.4.1. During the upgrade, we received a pre-release hotfix as well from Sitecore. When we are applying hotfix, we don't see updated Sitecore.Kernel.dll in cm and cd container. However for new dll which are not available in wwwroot folder, I can see those after applying the patch but existing files are not gettting modified. When we copy deltaAssetImage to the C:\Hotfix folder, it's copying files but with correct version. Not sure if something is overridding later in wwwroot folder or if files exist, it's not modifying. Below is the configuration: .env: SITECORE_VERSION=10.4.1-ltsc2022 SITECORE_ID_VERSION=8.0.28.325-10.0.20348.4529-ltsc2022 TOOLS_VERSION=10.4.0.171.7006-10.0.20348.643-ltsc2022 SPE_VERSION=7.0.0.107-ltsc2022 VERSION=10.4.1-ltsc2022 SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/ SITECORE_TOOLS_REGISTRY=scr.sit

Cannot rerun C++ code after compiling files are created

27 February 2026 @ 2:36 pm

I am learning how to code in C++ with VSCode in Windows, and am trying to print a "Hello world". I followed along the VSCode tutorial and, after I did that, wrote a small program that printed "Hello world". It worked fine. However, after I ran my program once, VSCode created a bunch of files: helloworld.exe helloworld.ilk helloworld.obj helloworld.pdb vc140.pdb as well as a .vscode folder containing a json file. I understand those files are needed because the code needs to be compiled. However, after I run my code twice I receive the popup error: "The preLaunchTask 'C/C++: cl.exe build active file' terminated with file code -1" This error disappears when I erase the files created by VSCode and rerun the code. How can I fix this?

Testcontainer in a Spring Boot test starts automatically without explicit code or annotation to start

27 February 2026 @ 2:34 pm

I am playing with Testcontainers and all the different approaches to use within a Spring Boot application. I am facing some strange issue. My tests should not be passing but it does and I don't understand how. I have the below test class where i am creating a PostgreSQLContainer instance annotated with @ServiceConnection. I am not using @Testcontainers and @Container annotation nor starting my container anywhere in the code. But when I run the test, it is passing without any issue. So how does my PostgreSQLContainer is getting started? Who is starting my PostgreSQLContainer? Is the @ServiceConnection starting my container? import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureRestTestClient; import org.springframework.boot.test.co

YouTube video works in browser but fails inside Flutter app with error 152-4

27 February 2026 @ 2:32 pm

I am developing a Flutter app (Android 12 and Android 14 tested) and embedding YouTube videos using youtube_player_iframe (or youtube_player_flutter). The videos: Work perfectly in Chrome on the phone Are set to "Unlisted" Embedding is allowed No age restrictions No copyright claims However, inside the Flutter app, the video does not load and shows: Error code: 152-4 "This video is unavailable. Watch on YouTube." Environment: Flutter SDK: 3.x Android device: Moto G60 / Android 12 Another test device: Android 14 WebView updated Example initialization code: YoutubePlayerController( initialVideoId: videoId, params: const YoutubePlayerParams( autoPlay: false, showFullscreenButton: true, ), );

Looking for a database of fish diseases (especially tilapia)

27 February 2026 @ 2:32 pm

I am currently looking for a structured database or publicly available dataset that contains information about fish diseases, especially those affecting tilapia. The dataset can include symptoms, causes, treatment methods, images, or any related biological data. I need it for academic purposes. If possible, I would prefer a dataset that is downloadable (CSV, JSON, SQL, etc.) or accessible through an API. Any reliable sources or recommendations would be greatly appreciated.

How to see data in the fields in the big query in testing environment having policy tags attached to it

27 February 2026 @ 2:31 pm

I have few fields in the big query table having policy tags attached due to which am not able to see the data in those fields , is any one aware how we can get access to policy tags fields in the testing environment

How to check which files has IFileOperation successfully deleted?

27 February 2026 @ 2:02 pm

When I call IFileOperation::DeleteItems to delete multiple files including one that I don't have delete permission to, it calls my IFileOperationProgressSink::PostDeleteItem for that file twice: the first time with hrDelete == 0x80270002, before putting up a confirmation dialog. If I select "Skip", it calls PostDeleteItem again with hrDelete == 0x00270005, which looks like a success. psiItem is non NULL for both cases. IFileOperation::GetAnyOperationsAborted reports TRUE, but that information is as useless as what SHFileOperation provides. How can I tell that the file operation for this specific file did not occur?