Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
General Q&A about programming, scripting, software design & architecture, process, tools, testing, and more.
Filters (None)
I'm currently using a static site generator (SSG) to convert a large collection of Markdown notes to a personal HTML/CSS wiki, but I decided to replace it with a Python script so I can fully custom...
I am using the Python SDK to access Azure OpenAI (GPT-4o / GPT-4o-mini). My usage logs show that I'm well below the Tokens-per-Minute and Requests-per-Minute limits for my instance. Even so, I so...
My Rationale I want to diagnose github.com/AchetaGames/Epic-Asset-Manager/issues/318#issuecomment-3641224648 — a failure to access a (likely non-existent) API endpoint. [1] On AOSP, I would invok...
I have a pyproject.toml [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" [project] name = "foo" version = "0.1.0" How do I get the project name f...
I try to set an icon (*.png) with javaFX, but it does not show in the task bar, instead I see the default icon (white cogwheel on light gray background). Here is my code: package application; ...
I am on a Debian Bookworm Docker image. My Rails6 project needs to convert HTML files to PDF. I used to do this with wkhtmltopdf, but wkhtmltopdf has not been supported for a long time now, and I w...
Again, I'm playing around with javaCC, and get those annoying warnings about "unused" and "dead code". Is there a decent way to put a @SuppressWarnings annotation on a whole package but not on the...
I try to run Flux2 inference on 2 GPUs as follows: import torch from diffusers import Flux2Pipeline from accelerate import PartialState import argparse from pathlib import Path def main(): ...
The task looks ridiculously simple, but I could not find a way of doing it but manually. I have a class with a @Override ... toString() method. I want to diversify this to a more specialized meth...
I'm trying to add a percent-based jitter function to the backoff package and use that modified package in my project instead of the PyPI release. Current jitter algorithm I want to implement (from...
When printing a java.time.ZonedDateTime, it's missing the seconds in output, is it a bug or a feature? See my code: package tryNcry; import java.time.Instant; import java.time.ZoneId; import...
What happens if I do python3 -m venv venv1 python3 -m venv venv2 source venv1/bin/activate source venv2/bin/activate Which venv(s) am I now in?
Consider the following situation: I have a GitHub repository for a LaTeX package: https://github.com/samcarter/beamertheme-spectrum This LaTeX package depends on a class, for which somebo...
I recently started learning regular expressions and I'm trying to use Python's re module, specifically the re.sub() function, to convert a subset of Markdown syntax to HTML whenever it appears in a...
How do I fix the following linker error when building a C++ project on Windows? LINK : fatal error LNK1104: cannot open file 'ncrypt_provider.lib'
In Godot 4.1.1 I moved some scenes and started getting parenting errors. I think I got that fixed, but I'm mentioning it in case it is important. I have an Area2d called House. house.gd has two c...
I need to wrap grep(1) in a script, and I'd like the script to have an exit code compatible with that of grep(1) --that is, it should return 0 if it found something, 1 if it didn't, and 2 on error-...
My Rationale At github.com/mysociety/alaveteli/issues/8958, I needed to post the rendered text of an .eml into a form that utilised GitHub's "GitHub-Flavoured Markdown" superset of CommonMark. Co...
Used to work with PhantomJS. Want to upgrade to Puppeteer. Started with some code: "use strict"; const puppeteer = require("puppeteer"); const capture = async () => { let browser; try {...
Helm keeps track of releases and their revisions by creating a kubernetes Secret each time a chart is installed, upgraded etc. These are of course useful in case you want to rollback, but they do p...
I have a big system which I want to test using Python scripts: using pytest or any other infrastructure. Some of my tests are of the "pass/fail" type; pytest has great support for these, like coll...
I’m trying to export cards from a Scryfall search so I can import them into a Moxfield collection. I’ve tried a simple script that dumps card names: Query Scryfall + dump card names for Moxfield ...
I'm using a Python script to merge code files: python codemerge.py --filters "*.py" --output merged_code.txt . The script uses gitignore_parser to skip files in .gitignore. My .gitignore exclud...
This code doesn't compile: package tryNcry; public class ExampleClass<S extends SomeClass> { S[] createArray(int n) { return new S[n]; // obvious compile time ERROR here: ...
I’m building a tool to check Magic: The Gathering deck legality in custom formats and want to update my formats with the same frequency as the Penny Dreadful format. Penny Dreadful updates when a n...
How can I serve OpenGVLab/InternVL3-1B with vLLM? I tried running: conda create -y -n vllm312 python=3.12 conda activate vllm312 pip install vllm vllm serve OpenGVLab/InternVL3-1B --trust_remo...
When writing Python-based apps (e.g. Django, Flask, etc.), it's often the case that import statements can be found all over the place, often more than once for the same module. For example, you can...
I have a Python script that needs to access some data (or configuration) file in its very own folder. For example, say script.py does something like this: with open('data.txt') as file: data ...
I'm learning some basic web scraping so I can download part of a static website for offline viewing. In the process, I'm running into link tags that look something like this: <a href='https://e...
I'm building a script for Lemmy that, given a user returns a list of communities sorted by engagement based on total votes and upvote percentage per community, to have an idea of other communities ...
I follow the instructions on https://github.com/Tencent-Hunyuan/HunyuanImage-3.0: conda create -y -n hunyuan312 python=3.12 conda activate hunyuan312 # 1. First install PyTorch (CUDA 12.8 Vers...
I want to update the capacity of a finetuned GPT model on Azure. How can I do so in Python? The following code used to work a few months ago (it used to take a few seconds to update the capacity) ...
Of course, everyone thinks to understand lambdas and generics. I was one of those until recently. Look at my code: package debug; import java.util.function.Function; public class Understand...
Currently, I have short key-value structures rendered as <table>s: This isn't ideal when the content wraps, because it wastes space, as the “Experience” section of the undermentioned, crin...
How do you fix the error 'Failed to load the DLL hostfxr.dll' when running a .NET test executed via dotnet test and starting an x86 .NET application in the test? I'm using .NET 8. Failed to load ...
When writing a dynamic web service, you broadly speaking have two paths: Use an existing web server (e.g. Apache, Nginx or Lighttpd) to handle the "raw" web requests and implement your own cod...
I want to use web search when calling GPT on Azure using Python. I can call GPT on Azure using Python as follows: import os from openai import AzureOpenAI endpoint = "https://somewhere.openai...
C# language version 8.0 introduces limited support for static methods, operators, etc. in interfaces. However, there are still limitations. I was hoping to use the new language features to try a ge...
The topic of how to implement polymorphism in C tends to pop up now and then. Many programmers are used to OO design from higher level languages and supposedly OO is a "language-agnostic" way of pr...
Why are keywords in SQL usually written in capital letters? For example: SELECT * FROM person WHERE mood = 'happy'; My understanding is that SQL is case insensitive, so the case doesn't actuall...
Our team is finally focusing on writing more automatic testing and one of my ex-colleagues recommended to try out the Verify library. The tool does the following: runs the test and compares the...
How can I verify that an extension method was called when using NSubstitute for unit testing? For a normal method I'd do something like: substitutedClass.Recieved().CheckedMethod(...) But exten...
I am trying to install the Spacy library in VSCode in a folder with a virtual environment. The output appearing in the terminal is excessively long; I will share it with a pastebin later. My versio...
When I write and execute a prompt in Cursor IDE, what specific information is included in the context that gets sent to the underlying language model (such as GPT or Claude)? E.g., does it include ...
github.com/kellyjonbrazil/jc/discussions/666#discussioncomment-14470622, and its immediate context, explain that lsusb does not appear to provide machine-parsable output, and that the available inf...
Premise The text/plain representation of my HTML5 markup is inequivalent to its CSS3 markup, even in manners which /plain is able to represent, like the amount of line breaks and depth (or even pr...
How do I run Python scripts on Android devices? There seem to be a bunch of different approaches; what are the advantages and disadvantages? In no particular order (and likely missing some usefu...
I'm trying to build a Rust program that uses Gtk4, specifically riff, but I think any Rust program that depends on Gtk4 will reproduce this error. However, Cargo keeps complaining that various Gtk-...
If I have some text in a cell, how can I find the number of times another piece of text appears in it? For example, suppose A1 contains Peter Piper picked a peck of pickled peppers.. pick occurs 2...
I have a fairly large C++ application that is reading Protobuf messages from the network using the Google Cloud CPP BigQuery API. If the data is too much, the application starts to use up a lot of...
