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.

Managing Unicode for windows with QMK (Keyboard firmware)

23 November 2025 @ 5:34 pm

I am playing on a qmk customized firmware (for keychron Q1 V1 ISO keyboard). I mostly want to rebind key to send unicode values (such as "ŭ" (esperanto keyboard)). I have followed https://docs.qmk.fm/features/unicode, I use in my rules.mk file: UNICODEMAP_ENABLE = yes And in keymap.c, I use UP keycode like this: UP(EO_UA,EO_UAU) with EO_UA and EO_UAU: [EO_UA] = 0x016D, // ŭ [EO_UAU] = 0x016C, // Ŭ Under Linux (using UNICODE_MODE_LINUX), I am fully happy about it. Under Windows (using the advised UNICODE_MODE_WINCOMPOSE), that is not working as expected. On my windows computer, I have installed the wincompose software and set it accordingly. Here is what I get when I send my unicode key:

Unreal Engine 5.6 compile error "SetEnv" path too long

23 November 2025 @ 5:32 pm

I was facing this issue a lot where you can't rebuild your game from unreal engine and it always comes with 1 error "SetEnv" path too long, most of you all might face this issue in the future as Unreal Engine 5.4 or later pushed users to use Visual Studio 2022, Unreal engine 5.7 maybe supports the Visual Studio 2026. I will include the answer in a simple way so everyone can save their time.

How can I locate a "potential security risk" on my Windows 11 computer?

23 November 2025 @ 5:29 pm

If I attempt to simply log my browser in to www.senate.gov the attempt is rejected with the message: Sorry, a potential security risk was detected in your submitted request. The Webmaster has been alerted. No further information is provided and the webmaster doesn't answer. I get this on both Firefox and Chrome, but don't get it trying to connect from my iPad, so it appears to be specific to my Windows 11 Dell G16 laptop, which has all current updates and passes a full virus scan by TotalAV. Any ideas on what to do next? Is there a site I could try to connect to that has very high security detection and also will tell me what the problem is?

Vercel live site not updating UI changes after successful GitHub push and redeploy (React/Vite)

23 November 2025 @ 5:27 pm

I am building a Habit Tracker application using React (Vite) and Tailwind CSS, deployed on Vercel. The Problem: I recently updated a component (HabitList.tsx) to fix a UI issue where an input field and an "Add New" button were invisible due to styling issues. I fixed the code locally, and it works perfectly on localhost. However, after pushing the changes to GitHub and triggering a new deployment on Vercel, the live site is still showing the old version of the code. The changes are not reflecting. What I have tried: Ran git add ., git commit, and git push. Verified that the code is updated in the GitHub repository. Checked the Vercel Dashboard: The deployment status is "Ready" (Green) and shows the latest commit

dynamic_cast to any one of several options

23 November 2025 @ 5:24 pm

Somewhat similar to this question, I have something like class DerivedA: public Base { void operation(const Base& x, const Base& y) override // pure virtual in Base { const DerivedA& xd = dynamic_cast<const DerivedA&> (x); const DerivedA& yd = dynamic_cast<const DerivedA&> (y); xd.some_method(); yd.some_method(); } }; The idea is that this operation was defined only when the inputs are both also DerivedA, because some_method is implemented only in DerivedA, and not necessarily in other derivatives of Base. But I want to slightly generalise this to allow x and y to be of either DerivedA or DerivedB because

Elementor Pro 3.32 Reduced Motion Preference

23 November 2025 @ 5:13 pm

In Elementor 3.32 pro, the builder now fully respects the user’s reduced-motion preference. This means that no Motion Effects are activated when reduced motion is enabled. I manage a school website, and because of this change, all animations and effects are being disabled on school computers. It’s a bit ridiculous, and there doesn’t seem to be any way to toggle this behaviour on or off. I understand the importance of accessibility, but in our case, the school computers disable animations and motion effects for speed and efficiency, not for accessibility needs. As a result, the site looks flat and doesn’t function as intended. Could we please have a toggle to enable or disable this feature? I’ve created a workaround, but it’s far from ideal. Is there another solution available? A possible Solution <script> (function() { // Check if reduced motion is actually enabled const hasReducedMotion = window.matchMedia('(prefers-reduced-mot

How to display array results in a grid instead of a single row or column?

23 November 2025 @ 5:08 pm

I have a single cell with data split with comma + space, like so: ENG, DE, FRE, ESP, CHN, KO, PL, CZ, PRT, JA, RU I can easily create an array with 1 string per cell, with SUBSTITUTE() and SPLIT() like so: =ArrayFormula(SPLIT(SUBSTITUTE([cell],", ",","),",")) The issue is that I need to display these results in a 4 x 4 grid, not in a single row or column, but my attempts at finding the solution have failed so far. I tried MAKEARRAY(4,4,LAMBDA(r,c,[array])) without success: nested arrays aren't supported, it returned #VALUE! in my 4 x 4 grid. I tried splitting the array in a row and then using =QUERY(FILTER(O26:Y26,O26:Y26<>""),"limit 4") thinking I could use LIMIT and OFFSET of the QUERY() formula to write a different formula on each of the 4 columns of my gr

How to write bytes as a b' string to a file?

23 November 2025 @ 4:44 pm

from PIL import Image img = Image.open('some/file.png') img = img.convert(mode='1') imgbytes = img.tobytes() with open('filepath', 'w') as file_out: file_out.write(imgbytes) I would like to write the sequence of bytes in imgbytes, as a string preceded with b', to a file. I don't need to encode it. write() doesn't accept bytes nor bytearray parameters.

How to handle errors in compose viewmodels?

23 November 2025 @ 3:28 pm

Imagine something like this: class FileModel: ViewModel() { private val _state: MutableStateFlow<FileState> = MutableStateFlow(initialState) val state: StateFlow<FileState> = _state.asStateFlow() fun readFile() { //read file and set state } } class DatabaseModel: ViewModel() { private val _state: MutableStateFlow<DatabaseState> = MutableStateFlow(initialState) val state: StateFlow<DatabaseState> = _state.asStateFlow() fun readDatabase() { //read database and set state } } readFile() and readDatabase() can fail. What I could do is store these errors in their respective states. But that would make it difficult to show them in the UI to the user, as I would have to listen to all states of several models. I would like to have a centralized model for errors:

HttpClient and headers

23 November 2025 @ 2:50 pm

I have a legacy .NET 4.8 framework project. I have tried to get these headers: Accept-Encoding CacheControl sent to my endpoint. But looking with Fiddler, they are not sent, even if I explicitly set them. Any idea why? HttpRequestMessage TmpRequest = new HttpRequestMessage(HttpMethod.Get, url); TmpRequest.Headers.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0"); TmpRequest.Headers.AcceptEncoding.ParseAdd("gzip"); TmpRequest.Headers.AcceptEncoding.ParseAdd("deflate"); TmpRequest.Headers.AcceptEncoding.ParseAdd("br"); TmpRequest.Headers.CacheControl = new CacheControlHeaderValue { NoCache = true }; HttpResponseMessage TmpResponse = await TmpClient.SendAsync(TmpRequest); Only the UserAgent is sent as header... But why not A