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.

No Overload matches this call, React native tab navigator screen options

1 February 2026 @ 6:04 am

// Bottom Tabs export type BottomTabParamList = { Home: undefined; Profile: undefined; }; export type TabBarIconProps = { focused: boolean; color: string; size: number; }; const Tab = createNativeBottomTabNavigator<BottomTabParamList>(); function MyTabs() { return ( <Tab.Navigator screenOptions={({ route }) => ({ tabBarIcon: ({ focused }: TabBarIconProps): Element => { let color = focused ? 'red' : 'black'; let size = focused ? 24 : 18; let icon: Element; if (route.name === 'Home') { icon = <House color={color} size={size} />; } else if (route.name === 'Profile') { icon = <User color={color} size={size} />; } return icon; }, tabBarActiveTintColor: 'tomato', tabBarInactiveTintColor: 'gray', })} > <Tab.Screen name="Home" component={HomeScreen} /> <

Payload CMS bulk image upload freezes browser when uploading thousands of images (base64 preview issue?)

1 February 2026 @ 6:03 am

I am using Payload CMS v3 as a backend and a separate Next.js app as the frontend. I have a Gallery collection in Payload. Each gallery belongs to an Event, and after an event ends, I need to upload a very large number of images (sometimes 1000+ images at once). 🔴 Problem When I try to upload many images at once in the Payload Admin (Gallery collection): The browser tab freezes / hangs CPU and memory usage spikes Upload becomes unusable for large batches This happens before the request fully reaches the backend. 🤔 My understanding (please confirm if correct) From what I can tell: Payload Admin converts each selected image to base64 to show a preview Base64 conversion:

Flutter GetX app freezes on startup due to multiple controllers and heavy initialization work

1 February 2026 @ 5:54 am

I am working on a Flutter health management system app that uses GetX with an MVC architecture. Current setup: Around 20–25 GetX controllers All API calls, Hive read/write operations, and business logic are happening inside controllers A custom step counter service implemented using native background services Some controllers were converted to GetxService, but the issue persists Problem: The app freezes on startup (onStart). The UI becomes unresponsive for a few seconds before rendering. Observations: Many controllers are initialized at app start Controllers perform: API calls

Weird IllegalArgumentException - Spring 6.1 cannot find controller method parameters despite -parameters being passed in compiler

1 February 2026 @ 5:45 am

I have been observing a weird issue in my application. Recently we started observing a lot of exceptions of this type in our logs: IllegalArgumentException: Name for argument of type [java.lang.Long] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag. The -parameters compiler option is already being passed (checked in Gradle debug logs, it's probably from the Spring Boot plugin) and when I run javap to inspect the compiled class, I can see the MethodParameters metadata section with the correct method arguments. Also, this issue seems to occur intermittently (as observed in Datadog). As in calls succeed sometimes and fail other times, even for the same methods. We use pinned version numbers for Spring (3.3.13) and it's dependencies so it's unlikely that this is some change in the Spring version. Also this was changed a long

Disable Exclusive Control in Audio Settings via Powershell script

1 February 2026 @ 4:35 am

So I'm trying to write a script to CLI disable the Take exclusive control setting in Windows 11. I can reliably pull the ID of the device, I can route it to a variable but the problem comes when I try and apply the property to the registry entry. This is my code to apply the property $regPath = "HKLM:\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\MMDevices\\Audio\\Playback\\{$Default_AD_Playback}\\Properties" $key = "b3f8fa53-0004-438e-9003-51a46e139bfc" New-ItemProperty -Path $regPath -Name $key -Value 0 -PropertyType DWORD This is the output I'm getting. Output is telling me I've got the wrong file path. Is it filepath or permissions? Anyone give me a hint? Yes in the image I was trying HKEY_Current_User but I've tried it with HKLM, Multimedia, MMDevices all give the same output Visual Code output

Using Span<T> with BitmapData.Scan0 without unsafe code

1 February 2026 @ 4:21 am

I have a loop that receives image data as a Bitmap object that I need to manipulate quickly in order to process the next frame. Consider the following code: private static void Main () { var opacity = (byte) 127; var channelAlpha = (int) 3; var pixelFormat = PixelFormat.Format32bppArgb; var boundsSource = Screen.PrimaryScreen!.Bounds; var copyPixelOperation = CopyPixelOperation.SourceCopy; var boundsTarget = new Rectangle (x: 0, y: 0, width: boundsSource.Width, height: boundsSource.Height); using (var bitmap = new Bitmap (boundsSource.Width, boundsSource.Height, pixelFormat)) { using (var graphics = Graphics.FromImage (bitmap)) graphics.CopyFromScreen (boundsSource.X, boundsSource.Y, boundsTarget.X, boundsTarget.Y, boundsSource.Size, copyPixelOperation); var bitmapData = bitmap.LockBits (rect: boundsTarget, flags: ImageLockMode.ReadWrite, format: pixelFormat); var buffer = new by

About using react-router-v5 on Electron

1 February 2026 @ 1:47 am

I want to use react-router v5 in electron app. I have a navbar component like this. But whenever I click on an Navlink (by default it's Home), it don't switch to exact component as I want. Here is my code: import * as React from "react"; import "./Navbar.scss"; import { HashRouter, Switch, Route, NavLink } from "react-router-dom"; import Homepage from "../../pages/Homepage/Homepage"; import Contact from "../../pages/Contact/Contact"; import About from "../../pages/About/About"; class Navbar extends React.Component { handleDirectPage = () => {}; render(): React.ReactNode { return ( <HashRouter> <ul> <li> <NavLink to="/" exact> Home </NavLink> </li> <li> <NavLink to="/contact" exact> Contact </NavLink> </li> <li> <N

React-Native Pressable's don't respond when page visited again after back navigation

31 January 2026 @ 11:15 pm

I have a Pressable a MyButton component which uses Pressable from react-native-gesture-handler: import React from 'react'; import { StyleProp, ViewStyle } from 'react-native'; import { Pressable, PressableProps } from 'react-native-gesture-handler'; export type MyButtonProps = { children?: React.ReactNode; style?: StyleProp<ViewStyle>; onPress: () => void; } & PressableProps; const MyButton = ({ children, onPress, style, ...props }: MyButtonProps) => { return ( <Pressable style={({ pressed }) => [ { opacity: pressed ? 0.5 : 1, }, style, ]} onPress={() => { console.log('onPress'); // logged only if page is visited for the 1st time onPress(); }} {...props}> {children} </Press

Find height of circle where visible area (not covered by rectangles) is half the total area

31 January 2026 @ 10:38 pm

Problem Description I'm trying to find the height of a circle's center (H) relative to a horizon (the x-axis). The sun is a circle with radius $R$ and its center is always at (0, H). The horizon is the x-axis (y = 0). There are N skyscrapers, represented as rectangles. Each rectangle $i$ is defined by its left x-coordinate (x_i), width (w_i), and height (h_i). The rectangles sit on the horizon, meaning their y-range is [0, h_i]. Visibility Rules: A part of the sun is visible only if it is above the horizon (y > 0). A part of the sun is not visible if it is covered by a building. Buildings do not overlap but can touch. Task: Find the height $H$ of the center of the circle above the horizon such that the total visible area is exactly half of the sun's total area (\pi R^2 / 2). Constraints

Script that creates HTML that references files in google drive

30 January 2026 @ 10:36 pm

I have a script that creates an HTML file, and I would like for the HTML to be able to access files on my google drive (mainly for img tags). I've found various posts that gives ways to do this, but they don't seem to work. Is there a way to use the file-id of a google drive file as the source for an img tag?