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.

What is best way to migrate 500 GB, 5 storeproc simple sql server 2019 database to gcp postgres [closed]

20 January 2026 @ 2:51 pm

What is best way to migrate 500 GB, 5 storeproc simple sql server 2019 database to gcp postgres Looking for step by step instructions. We are ok to have downtime.

Doing string interpolation using SpringTemplateEngine and thymelaf StringTemplateResolver

20 January 2026 @ 2:49 pm

Doing string interpolation and also using SpEL on some occasion for Json string. The target string output is json. which is just mapping the object to some other json string format. Example { "foo" : "[[${req.bar}]]" } which transform to json { "foo" : "xyz" } The issue occur, when bar is x"yz which transform to json { "foo" : "x"yz" } result in invalid json. The valid Json would be { "foo" : "x\"yz" } how to achieve this during the interpolation and not using any post processing or dialect addition Current config spring boot 2.7.17 thym

Core Dumped after copying string to 2D Array

20 January 2026 @ 2:47 pm

I want to add strings to a fixed 2D Array. I have a Core Dumped error when executing my addToList function. Indeed the program passes the list pointer and the string to add as arguements. I then iterate through the 2D list in order to find the last empty line (which should be == NULL ?) : #include <stdio.h> #include <stdlib.h> #include <string.h> #define ROWS 12 #define COLS 24 void addToList(char **list, char *string){ for(int i = 0; i < ROWS; i++){ if(list[i] == NULL){ puts("NULL DETECTED"); strcpy(list[i],string); } } } void printList(char **list){ for(int i = 0 ; i < ROWS; i++) fprintf(stdout,"%s \n", list[i]); } int main(){ char **list = malloc(ROWS * sizeof(char*)); for(int i = 0; i < COLS; i++){ list[i] = malloc(COLS * sizeof(char)); list[i] = 0; } if(list == NU

sklearn's FactorAnalysis varimax orthogonal rotation increases correlation of factors

20 January 2026 @ 2:44 pm

I'm using Scikit-Learn's FactorAnalysis in an application that relies on the assumption that the factors are uncorrelated. It would be great to have more interpretable factors, and an orthogonal rotation, such as varimax, should do the trick. I do not understand why doing this with sklearn.decomposition.FactorAnalysis(n_components=n, rotation="varimax") gives correlations that are orders of magnitude larger than with rotation=None. For my application r=1e-5 is negligible, but r=0.0015 is not. This effect can be observed (with differences of 3/10 orders of magnitude) in the example below, derived from scikit-learn decomposition examples, and I also observe it in my dataset, which is about an order of magnitude larger. It does not seem to depend (much) on the number of components and does not depend (for the

Why does my Java program hang even though one thread updates a shared variable? [duplicate]

20 January 2026 @ 2:42 pm

I am trying to understand Java concurrency and memory visibility. I wrote the following program: class SharedData { int flag = 0; } public class ThreadTest { public static void main(String[] args) { SharedData data = new SharedData(); Thread t1 = new Thread(() -> { try { Thread.sleep(1000); } catch (Exception e) {} data.flag = 1; System.out.println("Writer thread updated flag to: " + data.flag); }); Thread t2 = new Thread(() -> { while (data.flag == 0) { // busy waiting } System.out.println("Reader thread saw flag: " + data.flag); }); t2.start(); t1.start(); } } Problem: Sometimes the program never terminates and t2 keeps waiting forever, even though t1 clearly sets flag = 1. My questi

in cursor editor suddenly Prettier Code Formatter has stopped working for jsx file

20 January 2026 @ 2:33 pm

in cursor editor suddenly Prettier Code Formatter has stopped working for jsx file when i set setting.json to this it doesn't fromat files using prettier and gives the warning below FormattingExtension 'Prettier - Code formatter' is configured as formatter but it cannot format 'JSON with Comments'-files { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, }

podman fails to mount external volumes on MacOS [closed]

20 January 2026 @ 2:30 pm

i have a few big databases and I needed to mount one of those DBs on an external USB drive since may Mac ran out of storage. I faced a few issues doing that: running a container using podman run -v would fail due permissions on the external drive (e.g. stats permission denied). recreating the machine using -v option would work for the external volume but it would fail on any other volume using relative paths on command line or docker-compose.yml files (e.g. ./db-data/, ~/data-vol/). So I basically could either use relative paths or mount an external device, not both.

How to migrate data for email field

20 January 2026 @ 2:23 pm

So i have a char field which i was using to store emails. Now there are some rule/validation and processes for email fields like email validation and email normalization etc. I have to add the validation and email normalization on the field while keeping in CharField. what is the valid and safe ways to do this? I am using Django and Django REST framework.

How to remove the line under a SwiftUI Slider?

20 January 2026 @ 2:16 pm

I use a Slider in SwiftUI: Slider( value: $minDuration, in: minDurationRange, step: 10, onEditingChanged: { _ in }, minimumValueLabel: Text(""), maximumValueLabel: Text(""), label: { Text("") } ) .scrollIndicators(.hidden) .accentColor(accentColor) But it contains an unnecessary line in iOS 26. How can I remove this line? How to remove the line under the Slider?

Pivot table cells blank, despite correct data in Details view

20 January 2026 @ 2:07 pm

I have a simple data worksheet with a year column in Date format (only one of two years), and another column (Clutch.size) in Number format (containing nothing except numbers and blank cells). Pivot setup: Rows: Year Columns: Clutch.size (subtotal: Count) Excel has extracted the possible values of clutch size (0-14) as columns correctly. The problem is that every cell below - where I want to show the number of rows matching that clutch.size and year - is empty. Likewise the Grand Totals are blank too. But when I double-click on the individual cells (equivalent of right-click and "Show Details"), I do see the matching rows of data I'd expect, both by year and in the Grand Total row. The pivot table cells are formatted as Number (not that I've ever usually needed to change this in a Pivot table). If I change from Count to Sum I'm not seeing anything either. If I drag Clutch.size from Col