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.

Programmatic Execution & Results Extraction for Static Stress Simulation via Python API?

27 February 2026 @ 12:10 am

I am building an autonomous generative design agent using the local Python API (adsk.fusion). My pipeline successfully handles programmatic 2D sketching, extrusions, and parametric adjustments. My next step requires integrating an automated physics testing loop. However, looking through the CHM documentation, I cannot find any native API exposure for the Simulation workspace. Specifically, I need to script the following sequence headlessly via Python: Set up a Static Stress study on the active component. Apply a directional load (e.g., gravity/motor torque). Solve the mesh. Extract the minimum Safety Factor and Maximum Displacement as a float back to my Python script. My Questions: Is there any undocumented or upcoming exposure of the Simulation workspace in the local adsk.fusion API? If the l

SQL Query as a table

26 February 2026 @ 11:40 pm

How to save query as a table in SQL on BigQuery? I am doing data analysis and want to save a query as a table to reuse and save my time. I was running a query in BigQuery platform for the practice and got confused by this problem. What is the best practice for saving a query with its results for data analysis?

Maintaining top N key-values pairs in Cassandra's table

26 February 2026 @ 11:26 pm

I want to maintain a Cassandra table of key-value pairs (k,c). The table should store only the pairs with the top N values of the c integer field. Is there a way to do this in Cassandra?

S3 naming conventions based on Client or Topic?

26 February 2026 @ 11:16 pm

We have an s3 bucket where different clients will drop parquet files for different topics (userdata, revenue data, marketing data, etc). Is it better to name buckets as client and then topic? bucket/client1/userdata bucket/client2/userdata bucket/client1/revenuedata OR bucket/userdata/client1 bucket/userdata/client2 the topics are mostly similar but there are differences in schema (some have extra fields, some are missing fields). we plan to ingest this into databricks on a daily basis.

Windowing functions lead, last_value, get second to last

26 February 2026 @ 10:43 pm

I've got a table that's basically a movement graph, e.g. CREATE TABLE MoveGraph( Start varchar(10), End varchar(10), UpdateDate smalldatetime ) Problem is I want to know the ultimate destination (i.e. the last row values in the chain) and use them to add columns UltEnd and UltDate and to go back and update the transitional rows. I created "|" separated movement graphs (i.e. 'a|b|c|d', where they started at a, went to b, then to c, and ended up at d) and I've been monkeying with the windowing functions trying to follow the chain and make the update statements. The frustration is getting the (second to last, last) pair from the chain. I want to get (a,b), (c,d) (b,c), (c,d) for the example above or for 'a|b|c' (a,b), (b,c) All of the "second to last" posts I've found so far only assume trying to pull things from the end, not mixing

I'm starting to learn Java. What is the actual way of saving information of my classes, when I only run the program in the Eclipse IDE?

26 February 2026 @ 7:33 pm

Sorry for the question, I'm sure it's kind of dumb, but I am really new to this world. So I'm learning Java and I use Eclipse. I've learned the most basic things, like classes, arrays, lists, and I'm starting with HashMaps. My question is, since I'm creating projects like make a dictionary or an agenda, I need to input all the data to try all the methods and interactions, but since I only use the IDE itself and the terminal, all data is erased after. Is there a way to save all that data in this particular scenario? Looking for it I found something called Streams and I wonder if that's the direction I should head, or something more oriented to Databases, which I wonder if it's too complicated for my level. Thanks in advance!

Which languages are the best ones to opt for if the final goal is full stack and perhaps a switch into the ML and AI world

26 February 2026 @ 5:01 pm

I am looking for languages that serve as the best foundational languages I would need to step into full stack development, and use that base and experience to maybe switch to ML, AI, Data Science, maybe Fintech in the long run. I dont want to waste any time learning languages that would not help me in the long run. Any additional tools I should start learning about and integrate in my daily usage that might add onto my skillset?

How to convert a .txt file of 0's and 1's to a .bin?

26 February 2026 @ 4:43 pm

I am working on a project in which the first part I am to take a .txt file of 0's and 1's and convert it to a .bin file, of which I create a second program that takes that .bin file. I've been quite frustrated with this project, as my instructor just expects us to use AI to code it. This project is coded in VSC, and complied via g++ in WSL. I've been able to figure out how to make the program take multiple arguments, with argv[1] being the input and argv[2] being the output. After that I've done a simple file stream to read to the end of the file line by line (the txt file is 32 bits per line) and cout it for testing purposes. #include <iostream> #include <fstream> using namespace std; int main(int argc, char* argv[]) { if (argc != 2) { cout << "2 Command Line Arguments, Please." << endl; return 1; } ifstream inFS; string out; inFS.open(argv[1]);

How to ask Windows if a printer spools or not (in either .NET or Win32)?

26 February 2026 @ 3:43 pm

I have a situation in which my .NET 10.0/WPF app needs to know if a printer sends its content to the print spooler or prints directly. Is there a way to query Windows for this, either in .NET/C# or in C++? I am writing in C#, but I am comfortable using PInvoke to Win32 if necessary. On my Windows 10 box, the setting I am trying to query is controlled via the dialog below: image

Slow performance with SQL Server MERGE using Spring JdbcTemplate batchUpdate for ~14k records

24 February 2026 @ 11:40 am

I am experiencing significant performance issues when performing an "upsert" operation on a SQL Server table using Spring Boot's JdbcTemplate.batchUpdate in my Java 17, springboot 3.2.5 version app. I have a table called fund_return with a Clustered Unique Index on 5 columns. I am using a MERGE statement to either update existing records or insert new ones. The Table Schema: CREATE TABLE fund_return ( id int IDENTITY(1,1) NOT NULL, fund_code varchar(8) NOT NULL, currency varchar(3) NOT NULL, data_date date NOT NULL, period varchar(16) NOT NULL, holiday_type varchar(32) DEFAULT 'NextBusinessDay' NOT NULL, fund_return numeric(30,15) NULL, deposit_return_ann numeric(30,15) NULL, fund_benchmark_return numeric(30,15) NULL, modif_time datetime NULL, CONSTRAINT pk_fund_return PRIMARY KEY (id), CONSTRAINT uc_fund_return_unique UNIQUE CLUSTERED (fund_