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.

Spring Boot + Auth0: Health endpoint returns 401 on Azure App Service but works locally even though path is excluded from SecurityFilterChain

11 March 2026 @ 8:19 am

I'm implementing authentication with Auth0 in a Spring Boot application using the OAuth2 resource server. Everything works correctly locally, but after deploying to Azure App Service, I cannot access my health endpoint without a Bearer token anymore. I always receive 401 Unauthorized, even though the endpoint is explicitly excluded from authentication in my SecurityFilterChain. Expected behavior /health and /actuator/health should be accessible without authentication. Actual behavior When deployed to Azure App Service, accessing: GET /health GET /actuator/health returns: 401 Unauthorized However, the same endpoints work locally without a Bearer token. Additional troubleshooting I also tried moving the health endpoints into a separate

Handling seperated values inside a pandas dataframe item? [closed]

11 March 2026 @ 8:06 am

I am trying to translate Google Forms data from a classroom survey into .md files for Obsidian to use. I have downloaded dummy survey results as csv and using pandas have managed that much. The problem is that I need to hand in an anonimized version and that students should be able to select multipe classmates per question. This leads to values in the df like studentName1;studentName2. Using a simple .replace, these values get skipped over. I have thought about dumping the df to a temporary JSON file, going through that using string replacement/regex and then loading the JSON back in. This seems like a roundabout way to do this though and frankly a bit silly. What else can I try?

Convert relative time (in hours before or after a point in time) to clock time

11 March 2026 @ 8:03 am

I have a vector containing double values that represent hours before or after midnight: hours <- c(-2, -1.5, 0, 2.5, 4) These values correspond to clock times: -2 22:00 -1.5 22:30 0 00:00 2.5 02:30 4 04:00 The values of the hours can range between -24 (previous midnight) and 24 (following midnight), and the sequence increments by half hours (-24, -23.5, -23, -22.5, -22, ...), that is, all times are either full hours or half past the hour (00:00, 00:30, 01:00, 01:30, ...). How can I convert from the numeric representation of a relative time of day to a time of day in HH:MM notation? The HH:MM notation should not indicate whether it is on the day preceding or following midnight (or if it does, that indication should be easy to strip from the output, e.g. by something like abs(time_of_day) or gsub("-", &q

Megajs 0.17.2 root property broken

11 March 2026 @ 7:44 am

Im using megaJS 0.17.2 in my nodeJS program, but it seems like the root object is not being added to the storage (megaDB) object as a property, as seen in the following code clip of my initMega() function: async function initMega(){ const { Storage } = require('megajs'); try { let megaDB = new Storage({ email: process.env.MEGA_EMAIL, password: process.env.MEGA_PASSWORD }); megaDB.on('ready', () => { console.log("MEGA filesystem loaded."); console.log(Object.keys(megaDB)); //As you can see, it is run in the 'ready' event, so it should display inbox trash and root among others //root = megaDB.root; The root property is broken, so this line is also broken. }); console.log("MEGA connected"); return megaDB; } catch (err) { console.error("Mega failure: " + err); setTimeout(initMega, 3000); } } Does anyone know why the root property isn't appearing?

What is an Interface in Java?

11 March 2026 @ 7:44 am

i am currently lost. I am learning Java at school and we have a Project in which a group needs to explain a certain thing in Java. Mine is Interfaces. I am trying to research on what exactly Interfaces now are but i dont see any use cases in which it would be good to use let alone im questioning if i understand it correctly. Could anybody explain what exactly an Interface is and how i use it efficiently? Currently i know that it just gives methods to the class which implements the Interface but i dont see a use case for it due to the Method just being empty. You need to override it either way so why go through all this trouble to make an Interface if you just give the interface implementing class the Method anyway? I do apologize for my bad english, its not my first Language and im not that familiar with gramatically correct writing. Cheers

How to properly add a new section in internal RAM without breaking this linker script?

11 March 2026 @ 7:40 am

I am working on an embedded project in a microcontroller based on Cortex M7 and I've been asked to modify this linker script to add a new section .new_section which will always stay at the beginning of internal RAM. /* Section Definitions */ SECTIONS { .text : { . = ALIGN(4); _sfixed = .; KEEP(*(.vectors .vectors.*)) KEEP(*(.reset_handler)) *(.text .text.*) . = ALIGN(4); _efixed = .; } > rom . = ALIGN(4); _etext = .; .relocate : AT (_etext) { . = ALIGN(4); _srelocate = .; *(.ramfunc .ramfunc.*); *(.data .data.*); . = ALIGN(4); _erelocate = .; } > ram } I added the .new_section right after _etext = .; in order for it to end up at the beginning of the internal RAM. It so happens that there is a library in my code which declares parameters with __attribute__

How to execute the executables (packed as shared lib) from dynamic module on Android 10+?

11 March 2026 @ 6:56 am

I'm working on a IDE that runs on Android and includes SDK (actually GCC toolchains for various MCUs). To workaround Google Play 200Mb aab file size limitation i decided to pack every SDK as a dynamic module containing executables as shared libs and various files as assets. I expected to follow the native lib workaround (symlinking to the shared lib with human-readable executable lib symlinked from some fs directory) that works as expected on Android 10+ (if shared lib is a part of the apk/aab, not dynamic module). However the same workaround does not work with dynamic modules. To be more detailed. I renamed "xtensa-esp32-elf-g++" executable to "libesp32_xtensa-esp32-elf-g++.so", put it into into dynamic module "jniLibs/arm64-v8a" folder, installed the dynamic module programmatically in the app so the file path is "/data/user/0/%package%/files/splitcompat/7900/native-libraries/esp32_sdk.config.arm64_v8a/libesp32_xtensa-esp32-el

PHP built-in webserver cannot find PDO

10 March 2026 @ 10:18 pm

I run php -S 127.0.0.1:8000 on my computer and open in the browser my.php with the following content: <?php $pdo = new PDO("..."); $sql = "SELECT 'Hello, World!\n' AS message"; $stmt = $pdo->query($sql); $result = $stmt->fetch(PDO::FETCH_ASSOC); echo $result['message']; ?> Then I get an exception "Fatal error: Uncaught Error: Class 'PDO' not found" However, the class PDO is found without any problems when I run in shell the command php my.php. It is totally unclear to me why the code which works fine in the shell does not work for the built-in server. Any hints would be welcome! From phpinfo() I see "--disable-pdo" in Configure Command. But php -m outputs, in particular, PDO, pdo_sqlite, pdo_pgsql and other modules. And in

Compare the sum of two different values group by another column (distinct), and group by of "opposite" value

10 March 2026 @ 8:21 pm

I'm trying to write a query to find "matching" data from two different fields within the same table. For example, a table has a client column, amount charged column and location column. I want find the opposite charges that exist in both location columns. So for example client Richard Lewis has the same charge ($25 dollars) in both (location = A, location = B). Also the tricky part is I want to SELECT SUM(AMOUNT) FROM client_payments WHERE client_name = "Richard Lewis" AND location = 'A'; For example for Client John Smith (location A), the amount = 25, for (location B), amounnt = -25. I'm trying to find all the "pairing" like the John Smith example in the database. There are couple things I'm stuck on: SELECT * FROM ( SELECT * FROM client_payments LEFT JOIN amounts ? GROUP BY location, client ) ? How ca

Why do ANSI 256-color render incorrectly when running through Gradle rich console?

10 March 2026 @ 5:17 pm

I style my terminal output with ANSI 256-color. fun main() { val reset = "\u001B[0m" val colors = listOf(66, 219, 153, 221, 203) for (c in colors) { val bg = "\u001B[48;5;${c}m" println("$bg BG $c $reset") } } While running my Kotlin code with .\gradlew run --console=rich, I got the following render: console rich output This is incorrect render. For instance, according to this external source the color 153 should be sky blue, as shown when running the same code with .\gradlew run --console=plain: console plain output System Info: Kotlin 2.3 Gradle 9.14 JDK