StackOverflow.com

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

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

.NET Framework 4.5 in Azure Web App and FederatedAuthentication.SessionAuthenticationModule.WriteSessionTokenToCookie

18 September 2025 @ 10:27 am

I am trying to migrate a .NET Framework 4.5 application from on-premises IIS hosting into Azure Web App However, when I deploy the same code / config, I face issue with below code FederatedAuthentication.SessionAuthenticationModule.WriteSessionTokenToCookie I wrap it in a try-catch, but doesn't really throw an exception, just redirects to Error.cshtml page. Is above code not supported in Azure Web App? Thank you

WSO2 Revoke IS token for sub-organization

18 September 2025 @ 10:25 am

Scenario: User logs into our system with his IS Username and password (Super). He then selects the sub-organization he wishes to work with, and we do an organization switch to get a token for the sub-org. When the user closes the application, or clicks Logout, we want to revoke the sub-organization token (for security reasons). We call the .../oauth2/revoke?token=xxx endpoint. We use the same client id and secret that was used to do the org switch. Result: We get a status 200 back from the API, but when you try to use the sub-org token, it still works! We found that revoking a token that was issued on Super level, gets revoked as expected. What do we need to do to revoke a sub-org token?

R encounters fatal error when running rasterize (terra)

18 September 2025 @ 10:24 am

I am trying to run the (terra) rasterize function and in both RStudio and GUI it encounters a fatal error and requires new session start (or crashes). The line seems to have worked on smaller files but anything slightly bigger (and not big at all) it crashes. The code runs fine on another machine but not this one. I have tried uninstalling and reinstalling everything, using an older version of R, etc. I'm using R version R-4.5.1 I was running the following basic code code: library(terra) m <- rast(m_path) pts <- vect(gpkg_path) r <- rasterize(pts, m, field = 1, background = NA, fun = "max") When I run the last line to rasterize R 'encounters a fatal error' and crashes. This is the same when ran from GUI and RStudio. I am unable to share the data but as I say it runs fine on a different machine so shouldn't be the issue.

Why does one code run at load but the other one only when form submit

18 September 2025 @ 10:23 am

sorry if this is extremely basic, we just started learning PHP at class and I've got 2 exercises. In the first one, you can write 2 numbers on 2 html text inputs and choose an operation on a dropdown list. Then when the Submit button is clicked, theres PHP code to calculate the result based on the numbers and which operation was chosen, and it's shown underneath the form (this section was previously empty, so this appears at Submit): <form action="GET"> <label for="text1">Text 1</label> <input type="text" name="text1" /> <br> <label for="text2">Text 2</label> <input type="text" name="text2" /> <br> <label for="operacions">Escull una operació: </label> <select name="operacions" > <option value="add" />+</option> <option value=&q

GeoGebra Classic 5 — Can I save and run a batch of Input Bar commands from a plain text file?

18 September 2025 @ 10:23 am

I remember (from around 10 years ago) that in GeoGebra I could save the commands I would normally type into the Input Bar into a textual file, and then open/load/run them all at once, without having to copy‑paste them into the Input Bar one by one. Now I can’t figure out if I’m misremembering, or if such a feature still exists in current versions. Important constraints: I want to store the commands in a plain text file that I can open and edit in any text editor. I do not want to use .ggb or .ggt files, because those are binary containers. Ideally, I could run the text file either from the GUI (via some “load script” option) or from the CLI by passing it as an argument to GeoGebra. Environment OS: Windows 10 Pro 64‑bit GeoGebra version: Classic 5.2

How to add transparent <div> as a shield to prevent click on a video

18 September 2025 @ 10:18 am

Please how can i place a transparent element over a video on the page where it's embedded. I want the transparent to act as a shield element to intercept the clicks. This prevents the clicks from having an effect on the video. The video is hosted on wistia. I have zero knowledge on coding, and i am using free Elementor version. please i need help. Here is the page i want to edit I found some codes: .yourDiv {pointer-events: none;} but i dont know how to use it correctly

Postgresql ISSUE- Replication

18 September 2025 @ 10:17 am

[enterprisedb@DR-PG-SRV ~]$ pg_basebackup -h 192.168.1.43 -p 5444 -D /pgfs/dbcluster/area13mas/ -U replicator -v -P -X stream -R -Ft -c fast -Z 1 Password: pg_basebackup: initiating base backup, waiting for checkpoint to complete pg_basebackup: checkpoint completed pg_basebackup: write-ahead log start point: 16/81000028 on timeline 1 pg_basebackup: starting background WAL receiver pg_basebackup: created temporary replication slot "pg_basebackup_2643317" 4193524/15625338 kB (100%), 2/2 tablespaces pg_basebackup: error: backup failed: lost synchronization with server: got message type "6", length 825700664 pg_basebackup: removing contents of data directory "/pgfs/dbcluster/area13mas/" [enterprisedb@DR-PG-SRV ~]$ pg_basebackup -h 192.168.1.43 -p 5444 -D /pgfs/dbcluster/area13mas/ -U replicator -v -P -X stream -R -Ft -c fast -Z 1 Password: pg_basebackup: initiating base backup, waiting for checkpoint to complete pg_basebackup: checkpoint completed pg_baseba

How can I ignore a section of markdown with Doxygen?

18 September 2025 @ 10:16 am

I'm using Doxygen to build a docs website for a project. I use the project's markdown README as the main homepage. There is a chunk of the README that I want Doxygen to ignore. I'm pretty sure this used to work with <!--- \cond --> and <!--- \endcond --> comments. But this is now not working (at least since Doxygen v1.14). Here's as minimal as I could make my example: Doxyfile DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = "My Project" MARKDOWN_SUPPORT = YES GENERATE_LATEX = NO INPUTS += README.md USE_MDFILE_AS_MAINPAGE = README.md README.md <!--- \cond --> # MyProject ## I want to hide this section in doxygen's HTML docsbut But it's needed in the project README. It contains some information that is meaningful on GitHub but not for Doxygen. Also the title is re

NSAlert popup does not show app icon in latest macos version Tahoe 26.0

18 September 2025 @ 10:16 am

I couldn’t find any definite statement from Apple or in the public documentation so far that under macOS “Tahoe” (version 26.0) NSAlert has had a new, formal change that always hides the app icon. However, there are clues in Apple’s documentation and developer forum chatter that suggest that AppKit may omit the icon under certain circumstances, and what you’re seeing may be a consequence of one of those circumstances (or a bug/regression). Below are what I found and some workarounds you can try. What the documentation says Here are some relevant quotes and observations: The NSAlert class has an icon property. From Apple’s docs: “Icon — An optional, custom icon to display in the alert, which is used instead of the default app icon.” Apple Developer Relevant to your issue, under the docs for icon: “If you’ve set a custom alert icon, you can clear it by setting this property’s value to nil, which restores use of the app

Why does my log transformation output only black?

18 September 2025 @ 10:04 am

Here is my original code: # Formula: s = c * log(1 + r) c = 255 / np.log(1 + np.max(image)) log_transformed = c * np.log(1 + image.astype(np.float32)) log_transformed = np.clip(log_transformed, 0, 255).astype(np.uint8) This one outputs a black image. This is what I got from ChatGPT: log_transformed = np.log1p(image.astype(np.float32) / 255.0) # log(1 + r), r in [0,1] log_transformed = (log_transformed / np.max(log_transformed)) * 255 log_transformed = log_transformed.astype(np.uint8) It works, but I don't understand how. Also, did it follow the original formula? I don't get it at all.