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.

Client-side video crop + audio mux on iOS Safari with HEVC — any viable approach?

21 March 2026 @ 7:29 am

I'm building a web app where users upload a video, the app crops the first 60 seconds client-side, extracts audio for server-side AI processing, then muxes the returned audio back into the cropped video. This must work on mobile including iOS. The problem iPhones record HEVC (H.265) by default. Every client-side approach I've tried fails on iOS Safari for large HEVC files: WebCodecs: VideoDecoder.isConfigSupported({ codec: "hev1..." }) → false ffmpeg.wasm: fetchFile() copies entire file to JS heap → OOM (tab crash) captureStream: video.captureStream() not supported on iOS Safari canvas: must decode HEVC frames → ~8MB × 5 frame buffer → OOM File.slice() works for byte-level cropping with no decode, but I still need to mux a new audio track in afterward — which brings the same memory constraints back. What works - iOS + H.264: WebCodecs p

Is kDebugMode as reliable as assert() for exclduing code from release builds?

21 March 2026 @ 7:19 am

I have always been surrounding code that I don't want included in release builds in Flutter apps with assert((){ print('Debug-only code here'); }()); I vaguely remember this being the recommended way to do this way back in 2019. But now I realize that using kDebugMode (and kReleaseMode) seems to have the exact same effect: if( kDebugMode ){ print('Debug-only code here'); } Is there any difference between the two when it comes to completely excluding code from a release build (i.e. making sure that code is never included in any APK/IPA/etc)?

Are number of shards shared across regions?

21 March 2026 @ 7:08 am

We have configured our cluster sharding with number of shards 100 and we have 2 persistent actors with each unique type key. Upon checking the cluster management endpoint I noticed that shards for TypeKey1 has 100 regions while TypeKey2 also has several regions. Does this mean both persistent actor regions have 100 and if I add new persistent actor with unique key then I will have 300 in total? I’ve looked at the documentation but didn’t find clear answer to this.

Is there a way to convert Next.js (TypeScript) UI code into Figma design automatically?

21 March 2026 @ 7:04 am

I'm working on a project built with Next.js and TypeScript, and I currently only have the implemented UI (React components, CSS/Tailwind). I need to convert this existing UI into a Figma design file automatically (or semi-automatically), including layout, styles, and components if possible. I understand that Figma is usually used before development, but in this case, the design was not created beforehand. I've looked into some tools (like HTML-to-Figma plugins), but they either don't support React well or lose styling/layout accuracy. Is there any reliable tool, plugin, or workflow that supports converting Next.js (TypeScript) code into Figma designs? Even partial solutions (like exporting layout or styles) would be helpful.

Does ferror() indicator remain on when writing to a file?

21 March 2026 @ 6:47 am

I'm writing to a file using C, and would like to be sure to catch any errors in time, not necessarily immediately when the error happens, but still before I close the file. My current approach is as follows: FILE *f = fopen("file.txt", "w") int err; if (!f) handle_error(); fprintf(f, "foo %d\n", x); fprintf(f, "bar %s\n", s); err = ferror(f); if (fclose(f) != 0 || err) handle_error(); I'm not just calling fprintf twice, but quite many times, in the real program but I shortened the code snippet to just two calls. The idea is that I'm not checking the return value of fprintf every time, but instead I'm calling ferror() right before fclose(). My question is, does the C standard guarantee that the ferror() indicator remains on unless I explicitly call clearerr()? Is there any danger that the library fprintf imple

Flutter video_player plays glitchy or fails to play on a specific device after SDK updates

21 March 2026 @ 6:38 am

I am developing a Flutter chat application that displays videos in a feed (similar to WhatsApp). Recently, after updating my Flutter SDK and changing my Android compileSdk to 36, video playback has completely broken or plays glitchy on a specific device. It works perfectly fine on most of my testing devices (like iOS devices, Samsung devices, etc.). However, on one specific device (a Redmi phone), videos completely refuse to play or play with severe glitches. They often show a constant loading indicator or just a black screen, and the hardware decoder seems to fail. The Setup: Flutter SDK: Latest stable Package: video_player: ^2.11.1 (using standard VideoPlayerController.networkUrl) Android compileSdk: 36 (had to upgrade from 35 due to other plugin requirements)

Open worlt espero funcione es una conecion de conciencia humana y IA [closed]

21 March 2026 @ 6:34 am

<!DOCTYPE html> <html> <head> <title>Autenticación</title> </head> <body> <h1>Autenticación</h1> <form id="form-autenticar"> <label for="clave">Clave:</label> <input type="password" id="clave" name="clave"> <button type="submit">Autenticar</button> </form> <div id="mensaje"></div> <div id="menu" style="display: none;"> <h2>Menú:</> <ul> <li><a href=" <li><a href="#"> hola,mundo </a></li> <li><a href=" </ul> </div> <script> const claveSecreta = "el lara de aki"; const formAutenticar = "el l

Can I use GPL-2.0 license for a commercial product if my code is fully public(github)?

21 March 2026 @ 6:15 am

I would like to clarify the licensing terms of Swiss Ephemeris (specifically this repository: https://github.com/drvinaayaksingh/swisseph). From what I understand, this project is a Node.js wrapper for Swiss Ephemeris, rather than the original library itself. I also understand that Swiss Ephemeris required an AGPL license not just GPL. But wrapper project(github) license is GPL-2.0. My question is: If I use this wrapper in my project and keep the entire source code publicly available on GitHub, would it be allowed to use it in a commercial product and generate revenue? My project will be fully open source (public on GitHub) without config file(.env or application.yml etc) , and I plan to include the GNU General Public License v2.0 (GPL-2.0) in the LICENSE file. I would appreciate your clarification. Thank you in advance.

Unable to read sqlite table from "Python in Excel"

21 March 2026 @ 5:35 am

I'm trying to display the contents of a (local) sqlite table in Excel. I want to use "Python in Excel" for various reasons. This is the code I have written in cell A1 using the PY() formula: import pandas as pd import sqlite3 my_db = f'C:\\Users\\benpr\\mu_code\\nbssh.db' conn = sqlite3.connect(my_db) my_query = f'select * from results' df = pd.read_sql_query(my_query, conn) But I am getting the following when I try and validate: Error: Python DatabaseError: Execution failed on sql 'select * from results': no such table: results The table definitely exists and if I run the identical code in a Python script it queries and displays the dataframe without in any issue. From what I understand there are no extra steps I need to take when using Python in Excel so I'm at a loss to work out what I have not done right?

How should I manage resources used in multiple queue families?

21 March 2026 @ 5:32 am

I've been using Vulkan for about 7 months now and I've decided to start building a render graph. I was working on barrier generation when I realized I knew nothing about cross queue transfers and release/acquire barrier pairs. Most of what I know has been through AI, so forgive me if anything I say is flawed. I have a handful of questions regarding this matter that I would love help from a real person from though. 1: I noticed on this website this note: VkSharingMode is ignored by the driver, so VK_SHARING_MODE_CONCURRENT incurs no overhead relative to VK_SHARING_MODE_EXCLUSIVE. Is that really true? Can I still write relatively simple barriers for no cost? 2: If I have a release barrier at the end of a frame that should send a resource from Queue A to Queue B, but my render graph is recompiled and barriers are re-generated, can I treat the orphaned release barrier as if it never existed, or do I have to