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.

Safe way to perform major version migrations between unsupported RDS versions when deployed with aws-cdk

3 January 2026 @ 4:47 am

I have an EC2 instance running Amazon Linux 2023 with a Python application running on it connected to PostgreSQL Currently PostgreSQL is running inside RDS with major version 14.x The entire setup has been created with aws-cdk using Typescript I want to migrate RDS to 18.1 As you can see from their documentation here migrating from 14.x to 18.1 is not supported If I were to jump to my aws-cdk code, change the RDS version from 14.x to 18.1 and run aws cdk deploy I am assuming it will simply delete the old database and create a new one in its place How do I handle this type of migration when using aws-cdk without blowing up my data?

track_total_hits vs _count which one is better

3 January 2026 @ 4:44 am

in my Elasticsearch index there are around 10M document, pagination based query is happening on this, on UI need to show total count of document matching query along with some data in page-format, there are 2 approach for showing count track_total_hits set as true in request make a count based query separately which one is better? I think using separate count based query would be better as count also would be cached using request cache, while for track_total_hits with each request it need to re-calculate count again even if user move to the next page. am I correct? for such decision making do I need to consider approx. how many pages each users checks?

How to fix Playwright error on Collapsible Sidebar Menu

3 January 2026 @ 4:35 am

Tried to write a Playwright script for Navigating on dashboard pages, however when clicking on the collapsible sidebar, it says Timeout exceeded. I tried adding delay however it seems its not working: Any thoughts is appreciated. import {test} from "@playwright/test"; //Login test("test login flow", async ({page}) => { const username = "uat1@uat1"; const password = "1234"; await page.goto("https://uat-portal.goleo.app/Default", { waitUntil: "commit", }); await page.getByRole("textbox", {name: "Username"}).fill(username); await page.locator('[type="password"]').type(password, {delay: 50}); await page.locator("#DrpLocation").waitFor(); await page.locator('[type="password"]').fill(password); await page.keyboard.press("Enter"); await page.locator("#updatepanel1").click(); //Navigate to Dashboard await

infinite loop while wrriting simple sub routine for outputing a string without stack in x86-64

3 January 2026 @ 4:20 am

i had a sub routine for printing a string dynamically, without manually listing the length of the string in x86-64 intel style through following code (with stack) :- section .data output1 db "hello world",10,0 output2 db "hello world again",10,0 section .bss section .text global _start _start: mov rax,output1 call _output mov rax,output2 call _output call _exit _output: _output_setup: push rax mov rbx, 0 _output_length_loop: inc rax inc rbx mov cl,[rax] cmp cl, 0 jne _output_length_loop _output_output: mov rax, 1 mov rdi, 1 pop rsi mov rdx, rbx syscall ret _exit: mov rax, 60 mov rdi, 0 syscall ret but i wanted the sub routine without stack so i tried writing the sub routine to do the same without using the stack so i did through following:- section .data output1 db "print this string",10,0 ou

Cura batch file operation

3 January 2026 @ 4:16 am

I'm trying to make a little system that will allow me to put files into a folder, then use a 3D printer slicer, Cura, to slice them without me having to slice them one at a time in the window. I tried using AI to help me build the code and understand, but I think I'm not understanding what's going on anymore. I tried slicing a file called "DE1-014-Melting" and these are some error messages I got. Anyone got any help? I don't really know much about batch files at all, so I'm really struggling. [error] Unknown option: C:\AutoSlice\Input\DE1-014-Melting [error] Command called: C:\Program Files\UltiMaker Cura 5.8.0\CuraEngine.exe

sqlite timezone change UTC to asia/kolkata

3 January 2026 @ 4:13 am

I am creating a crud application using Node JS, Express JS & SQLite database. For every database insertion i am using a column 'created_at' to insert current timestamp. But according to my timezone, it only saves the time less than 5hr 30 min from the current timezone which is 'Asia/Kolkata'. How to resolve? find my reference database.js where i create the database database.js const sqlite3 = require("sqlite3").verbose(); const db = new sqlite3.Database("./database.sqlite"); db.serialize(() => { db.run(`CREATE TABLE IF NOT EXISTS users ( id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(100) NOT NULL, email VARCHAR(50) UNIQUE NOT NULL, password VARCHAR(255) NOT NULL, token TEXT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP )`); db.run(` CREATE TRIGGER IF NOT EXISTS update_users_updated_at AFTER U

Count intersections of an Android swipe code

3 January 2026 @ 4:08 am

I am trying to count the intersections in an Android-style swipe code in Python. By "swipe code", I mean the line segments created by connecting a path (length 9 tuple) of the digits from 0 to 9 on a 3x3 grid: 0 1 2 3 4 5 6 7 8 I have the following code to visualize a particular 9-tuple: def coords(number): y, x = divmod(number, 3) return x, y def draw_arrow(i, j): x1, y1 = coords(i) x2, y2 = coords(j) dx = x2 - x1 dy = y2 - y1 plt.arrow(x1, y1, dx, dy, head_width = 0.04, width = 0.01, ec ='green') def draw(path): # By default, the input is a length 9 tuple plt.clf() for i in range(0,3): for j in range(0,3): plt.scatter(i, j, s=200, c='black', edgecolors='black') plt.ylim(2.1, -0.1) for i in range(len(path)-1): draw_arrow(path[i]

RVC inference but stuck in dependency

3 January 2026 @ 3:55 am

I want to run inference for a sample voice on pretrained voice model, but I am failed to download correct dependency for it, i tried everything but still not resolving issue, if anyone who knows how to run inference without any dependency issue , reply me.

What's the minimum and maximum escape numbers are supported in the regular expression

3 January 2026 @ 3:44 am

I want to escape all numbers into characters in regular expression, but I don't know what numbers can be converted to what characters. For example, I want to escape all the following numbers: \123 --> convert to some '<unknown char>' \456 --> convert to some '<unknown char>' \789 --> convert to some '<unknown char>' \256 --> convert to some '<unknown char>' \257 --> convert to some '<unknown char>' \258 --> convert to some '<unknown char>' \1234 --> convert to some '<unknown char>' \567890 --> convert to some '<unknown char>' Here is the python code for testing: import re p = re.compile('[\123\456\789\256\257\258\1234\567890]') print(p.match("0123456789")) Here is the output: # python3 >>> import re >>> p = re.compile('[\12

Visual Studio Code auto completion

3 January 2026 @ 3:35 am

I am new to coding and I recently downloaded VS code on my MAC to code, the thing is that I am tired of whenever I write something, suppose a tag like <ul> then VS code automatically puts the closing tag </ul> by itself, I saw few videos and asked chatgpt how to close this automatic completing thing, but it did not helped properly, does any one know how to turn this thing off? As of now I definitely want to type in the whole code by myself