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.

Bearer error="invalid_token", error_description="The signature key was not found"

11 April 2026 @ 11:53 am

Trying to use OpenApi and Scalar to add authentication to Asp.Net Core Web API. When I call my authorised controller with my bearer token I get this response message: Bearer error="invalid_token", error_description="The signature key was not found" Here is my program.cs: using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi; using Scalar.AspNetCore; using System.Text; var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(); builder.Services.AddOpenApi("v1", options => { options.AddDocumentTransformer<BearerSecuritySchemeTransformer>(); }); builder.Services.AddAuthentication(x => { x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; x.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; x.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; }).AddJwtBearer(o => { o.RequireHttpsMet

React 19 useTransition behaves weirdly with multiple async updates to state

11 April 2026 @ 11:07 am

with startTransition React can now decide some updates are not a high priority and can choose to ignore rendering an older update if its taking too long and continue with the latest one. eg. if we are using setState to update a field from temp1 -> temp2 -> temp3 ..... -> temp10, startTransition can ignore the middle updates which are taking too long and skip some or all of them to go to temp10. there are 2 things we need to look at when figuring out multiple state updates. batching: react will automatically batch updates if they are synchronous. eg. temp1 -> temp2 these will be batched together startTransition: react can ignore low priority updates and if a new update comes in, it can start rendering new one So here's my question: I am updating field from temp1 to temp10. there is a delay of 1 second between couple of updates as shown below import React, { useRef, useState, useTransit

Unable to Debug kernel with KGDB

11 April 2026 @ 11:00 am

I tried to debug kernel with KGDB. So I compile kernel: ENABLING_KGDB I Flash that kernel into my VmWare VM, then create new virtual serial port in my VM as socket pipe(/tmp/kgdb-socket). Then I enabled kgdb in my VM according to this post. Debug_Kernel_KGDB. Then when I tried to connect to kgdb from gdb i got this error: Ignoring packet error, continuing... warning: unrecognized item "timeout" in "qSupported" response Ignoring packet error, continuing... Ignoring packet error, continuing... Bogus trace status reply from target: timeout Even I tried to use kgdb_agent_proxy, and connect fr

LocalizedStringResource is passed in an Interpolated String with an invalid segment

11 April 2026 @ 10:42 am

Trying to localize an interpolated string using Strings Catalog. Strings must be represented as LocalizedStringResource here, there's no other option. // Error: 'LocalizedStringResource' is passed in an Interpolated String with an invalid segment. static var title = LocalizedStringResource( "OpenIntent.Title", defaultValue: "Open \(LocalizedStringResource("AppName", table: "Shared"))", table: "Shared" ) Shared.xcstrings: { "sourceLanguage" : "en", "strings" : { "AppName" : { "extractionState" : "pasted", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", "value" : "HeartBLE" } } } }, "OpenIntent.Title" : { "extract

SSL configuration issue when using Cloudflare with InfinityFree hosting (HTTPS redirect problem) [closed]

11 April 2026 @ 10:41 am

I am a web developer and I am currently hosting my website on InfinityFree. My website is: https://callboychennai.infinityfreeapp.com/ I have SSL enabled from my hosting provider, and now I am trying to integrate Cloudflare for CDN and security. After enabling Cloudflare, I am facing issues related to HTTPS, such as redirect loops / SSL handshake errors / or site not loading properly over HTTPS. My current setup: Hosting: InfinityFree SSL: Enabled from hosting CDN: Cloudflare (in progress setup) What I want to know: What is the correct SSL mode to use in Cloudflare (Flexible, Full, or Full (Strict)) in this case? Do I need to disable hosting SSL when using Cloudflare? How can I avoid redirect loops or SSL conflicts? I want to ensure my s

Linking a shared library(.so) to a static library(.a)

11 April 2026 @ 10:26 am

I would like to know whether it's a good design decision or even possible to link a shared library libabc.so to a static library xyz.a? Also, if I link this static library libxyz.a to another shared library def.so, does the shared library libdef.so will be able to find the function definitions of both libabc.so shared library and libxyz.a static library? CMakeLists.txt of libxyz.a target_link_libraries(xyz PUBLIC abc) CMakeLists.txt of libdef.so target_link_libraries(def PUBLIC xyz)

How to determine the directions of the world coordinate system in 3D space

11 April 2026 @ 10:21 am

I'm a Babylon.js newbie and I'm confused about the coordinate system.I want to know how the directions of the world coordinate system's x, y, z axes are determined when the camera position changes in 3D space. Could any experts please help me understand this? Thank you very much!

Templates templates with extra parameters for reuse

11 April 2026 @ 10:15 am

I have a class model that is good case for CRTP templates. Most information is static, the classes are singletons wherefore I can access them using ther type names as opposed to object references. In pseudo code: // Bridge base template class BridgeBaseT < class tDerivedBridgeType, class tRequiringDomain, class tProvidingDomain >; // Bridge types SingleBridgeT < class tDerivedBridgeType, class tRequiringDomain, class tProvidingDomain > : public BridgeBaseT<tDerivedBridgeType, tRequiringDomain, tProvidingDomain>; ThreadedFixedBridgeT < class tDerivedBridgeType, class tRequiringDomain, class tProvidingDomain, const FixedQueueSize tQueueSize = FixedQueueSize::_15_SLOTS > : public BridgeBaseT<tDerivedBridgeType, tRequiringDomain, tProvidingDomain>; ThreadedDynamicBridgeT < class tDerivedBridgeType, class tRequiri

What's the Scope of Selenium Testing over the next 5 Year?

11 April 2026 @ 6:15 am

I have assigned the role of Java Selenium tester in MNC and right now I'm in training phase for the same. But As the increasing uses of AI I'm confused if this is a right career path or not? If Yes, then what's the growth in this and how I can upscale my self for better and faster growth?

Programming languages in the AGI era — which ecosystems best complement AI-generated code?

11 April 2026 @ 2:53 am

In the AGI era, the bottleneck of software development is shifting from writing code to verifying and trusting code. AI can generate code in any language — but the language's compiler guarantees, type system, and ecosystem dramatically shape how safe, maintainable, and correct that generated code actually is in production. This raises a strategic question: which programming languages are best positioned to serve as a "runtime contract" that catches AI mistakes automatically? The core insight The best languages for the AGI era are those where the compiler or type system acts as an independent verifier — one that doesn't trust AI output, just as it doesn't trust human output. This shifts the question from "can AI write code?" to "can the language ecosystem catch AI mistakes without human review?" Language-by-language