StackOverflow.com

VN:F [1.9.22_1171]
Rating: 9.2/10 (11 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

How do I make Google Chrome not crop off the bottom of a CSS drop-shadow effect when using a CSS mask?

4 November 2025 @ 9:05 pm

I want to put a horizontal line with a glowy effect beneath the headings on a webpage, where both the line and the glow fade out at the left and right ends. I've got it working almost exactly the way I want in Firefox, but in Google Chrome the bottom of the glow gets cropped off. Specifically, in Chrome it always looks as if the no-clip property is not set (or at least, removing that property makes Firefox crop off the bottom the same way Chrome does). Does anyone know how to fix this? Here's a runnable code snippet: html { background: black; font-size: 16px; margin: 0; } .first-heading { margin: 0.9375rem 3.5rem; font-family: serif; font-weight: 400; font-style: normal;

Haskell data declaration with existential quantification

4 November 2025 @ 9:00 pm

MRE: data Foo = Bar (forall x.(Num x) => x) I want the x to be a Num or a Bool, but as their kinds are different, (* -> Constraint v/s *) haskell complains if I define (Num x, Bool x) => x. What should I do here? The closest I can think of is Bounded, but that will open up another can of worms.

Problem with SDL2 and SDL3 in Code::Blocks

4 November 2025 @ 8:58 pm

I'm on Windows 11 and Code::Blocks. I don't get any error messages with SDL3, but with SDL2, which I used before, it says "ld.exe cannot find -lsdl2: no such file or directory," even though I have no trace of SDL2 on my computer.

LockedCameraCaptureExtension and Sharing User Preferences

4 November 2025 @ 8:53 pm

I have the main app that saves preferences to UserDefaults.standard. So I have this one preference that the user is able to toggle - isRawOn UserDefaults.standard.set(self.isRawOn, forKey: "isRawOn") Now, I have LockedCameraCaptureExtension which is required know if that above setting on or off during launch. Also if it's toggled within the extension, the main app should know about it on the next launch. The main app and the extension runs on separate containers and the preferences are not shared due to privacy reasons. Apple mentions of using appContext of CameraCaptureIntent, but not sure how above scenario is possible through that....unless I am missing something. Apple Reference

Can I restrict a child's height based on parent while restricting parent width based on children? [closed]

4 November 2025 @ 8:43 pm

I have a "popup" dialog-like container meant to prompt the user to choose one of two options. The dialog is meant to be fully on-screen, and the options are images that are taller than wide, so height will be the constraining dimension. I've been trying to get the images to sit next to each other in the same row, but either they are left too tall and overflow the dialog (constrained by parent width), or they are properly constrained by parent height, but the "row" div then has extra whitespace which appears to be exactly the width we would have had if the images were constrained by width instead of height. *, *::before, *::after { box-sizing: border-box; } #popup { box-shadow: 0 0 12px rgba(0,0,0,

How do I find out what's causing these valkey AWS Elasticache requests to timeout?

4 November 2025 @ 7:58 pm

We have sporadic, but repeatable, timeout issues with valkey at higher loads that we haven't been able to diagnose the root cause of. We're using StackExchange.Redis on the old school .NET Framework 4.7.2. The errors look like the following: Timeout performing GET (5000ms), next: GET key, inst: 529, qu: 0, qs: 0, aw: False, bw: SpinningDown, rs: ReadAsync, ws: Idle, in: 0, last-in: 1030, cur-in: 0, sync-ops: 2657465, async-ops: 2153530, serverEndpoint: valkey:6379, conn-sec: 2204.62, aoc: 0, mc: 1/1/0, mgr: 10 of 10 available, clientName: EC2(SE.Redis-v2.8.41.44383), PerfCounterHelperkeyHashSlot: 3877, IOCP: (Busy=0,Free=1000,Min=50,Max=1000), WORKER: (Busy=57,Free=32710,Min=50,Max=32767), v: 2.8.41.44383 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts) I've been through the attached link and the only thing that

Switching system tray icon's image without delay

4 November 2025 @ 7:22 pm

I have a .NET program which includes the option to enable/disable a functionality by clicking the system tray icon. When I click the system tray icon, I switch from one icon/image to another to show if the feature is enabled or disabled. I use the .Icon property to set the icon/image I need. This works, but I am facing an issue. There is a delay of around 300-500ms after clicking the system tray icon for the new icon/image to show. Also, I feel like there is a fading effect switching from one image to another. I do not want this delay and I do not want a fading effect when switching. I want my change to be instant. Here is what I have tried: Setting the system tray icon Visible property to false, switching the image, and sitting it back to true Setting the system tray icon Icon to null then setting the new image/icon on Icon Those worked but there is a flic

Installing OMPL on Anaconda in Windows

4 November 2025 @ 6:24 pm

I cloned the OMPL repo into my system and tied to install it. So, I used these commands: First I cloned it from the repository using https://github.com/ompl/ompl.git Next I created a new folder inside my ompl folder - ompl\build Next, to build them, I used: cmake .. -DCMAKE_BUILD_TYPE=Release -DOMPL_BUILD_PYBINDINGS=ON -DOMPL_BUILD_VAMP=OFF -DCMAKE_CXX_FLAGS="-D_USE_MATH_DEFINES" cmake --build . --config Release -j4 But when I ran a sample program, I always get ModuleNotFoundError: No module named 'ompl' I think I have no idea what I am trying to do. I have a virtual environment inside Miniconda in Windows, and I am trying to use OMPL inside it. I also installed all the required dependency. If somebody has faced the same issue, can you help me with the installation?

T-SQL way to simply list the Inflectional Forms of a word?

4 November 2025 @ 6:00 pm

We're using fulltext indexes in current builds of SQL Server and/or Azure SQL - compatibility levels well over SQL Server 2016 or higher, preferably SQL Server 2022 on Azure. While the searching in a fulltext index is fine, what I can't seem to figure out is how to simply list the inflectional forms of a word. So rather than using FORMSOF(INFLECTIONAL, somewordhere) in a CONTAINS or CONTAINSTABLE search or whatnot, I would like to simply be able to do (in "pseudocode") SELECT FORMSOF(INFLECTIONAL, somewordhere) I had a look around on Stack Overflow and I think this question touches on what we're trying to do, but it crucially doesn't include the SQL syntax the poster may have been using: Inflectional words of word in 'English' language Whatever the correct syntax is, l

Quarto trying to render script files

4 November 2025 @ 5:38 pm

I'm putting together an academic website with a publications section. I've written a script that will turn a bibtex file into article-by-article quarto and bibtex files that then use a custom template. So, the structure of this part of the website looks like. | | |--publications |- index.qmd |- bib_2_qmds.R |- _ejs | -- article.ejs | | |-- articles | |-- article_1 | |-- index.qmd |-- article_1.bib With many more articles. The YAML for the publications index.qmd file is as follows --- pagetitle: "Publications" toc: false title-block-style: default # default, plain, none page-layout: full listing: - id: articles contents: articles/**/*.qmd template: _ejs/article.ejs categories: false sort: - "year desc" - "title" sort-ui: [year, title, author, publication] filter-ui: [year,