October 24, 2024
Chicago 12, Melborne City, USA
security

Spring Boot 3: SecurityContextHolder returns null in CompletableFuture, works fine in Spring Boot 2

I’m migrating an application from Spring Boot 2 to Spring Boot 3, and I’ve encountered an issue with security context propagation in asynchronous code. I have a REST controller method that executes long-running logic asynchronously using CompletableFuture. Here’s a simplified version of the code: CompletableFuture.supplyAsync(() -> logic()) .thenApply(it -> { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); //

Read More
SQL

Defining the target database with Entity Framework migration script generation

Generating script with Entity Framework requires the script to be run on a specific database. In our setup, we want our database administrators to run the script, but at the same time we want to ensure that the script is not executed on an unintended database. This is easily achieved by starting the script with

Read More
CSS

How to change container border based on child inputs placeholder state (tailwind)

I’m trying to set border color of a parent container which contains an input element when placeholder is not shown anymore – the closest working solution that i got was with focus-within but that isn’t ideal as i want for the border to stay colored even after focus is lost – depending on whether text

Read More
C++

fallocate not defined in QEMU 7.2.14 trying to compile on windows using mingw

Trying to compile QEMU 7.2.14 so I can use HAXM virtualizer to accelerate it (not using hyperv) and I’m getting an error saying that the fallocate function is not found in file qemu/softmmu/physmem.c line 3600, I have already tried looking for a fix but I can’t find one & this function seems to be linux

Read More
jQuery

Requesting Notification permission token with Firebase Cloud Messaging

I’m trying to request a Notification permission token with Firebase Cloud Messaging with JavaScript. My current code works, but as explained in the code comment, there seems to be a strange behavior regarding the steps. What should happen: User clicks on send reminders html button, browser asks for notifications permissions, user clicks on allow, user

Read More
HTML

What causes this failure to filter a table?

I am trying to filter a table using plain JavaScript. I have an input of type search and I filter the table rows by the value typed in that input. function searchTable() { var input, filter, table, tr, tds, i, txt input = document.querySelector(".search-box") filter = input.value.toUpperCase() table = document.querySelector(".table-search") tr = table.querySelectorAll("tr") for (i

Read More
Android

How to reduce build time for a Compose Multiplatform project in Android Studio?

I’m developing a Compose Multiplatform project targeting both Android and iOS, and I’m experiencing long build times, especially during Kotlin compilation for multiple platforms (Android and iOS). The build process frequently shows warnings, like those in the image below: Some points to consider: I’m using compileSdk = 35 for Android, but I get warnings suggesting

Read More
PHP

Keeping Laravel Powergrid table's first row visible while loading with wire

I’m using Laravel Powergrid and I’ve added the wire:loading directive to show a skeleton loader whenever table actions are performed (e.g., page change, per-page value update, filter, and search). The thead is always visible during these actions, but I also want to keep the first tr inside the tbody (which contains the filter/search row) visible

Read More
C#

Are there some sort of hidden optimization for the sin() function in C?

Recently I’ve been looking at some methods of approximating sine, and tried comparing the speed difference between using a sine look-up table (LUT) with linear interpolation and the standard sin() function in C. The way I tested the speed was through iterating over a range of angles from 0-pi/2 at a specific step angle using

Read More
java

Timer delay fluctuations in Java – how to improve?

I am trying to put together a timer class for a game. Until now, I was just using javax.swing.Timer, but after trying to do some operations that require more exact timing (specifically visual interpolation between two ticks’ states when rendering more frames than there are ticks), I found this class’s limitations and it proved unusable.

Read More