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)
My goal is to programatically convert Markdown tables to their HTML equivalents using regular expressions. I haven't been able to find any Python-compatible regexes for Markdown tables online, so I...
I'd like to implement a macro strnul(): #define strnul(s) (s + strlen(s)) But that expands and evaluates s twice. I'd like to avoid that. I could do (using GNU extensions) #define strnul(s)...
Are there any standards for creating machine readable sitemaps with a hierarchical structure similar to the outline on the left sidebar on sites like https://just-the-docs.com/? The Sitemaps XML f...
My goal I'm looking for a way to programatically generate a visual representation of interlinked sections in a text file (preferably in svg format), with particular aesthetic considerations. The ...
I had a PR that was accepted. Now I make another one, but it also push my past commits. I have created a new branch but it doesn't solve the problem. Why does this happen and how to prevent this?
Is there a way to link to specific code lines for a Markdown file[1] in Bitbucket? I have found a UI toggle for each of GitHub, GitLab, and Forgejo that adds a query string to disable the pretty ou...
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...
While learning JavaScript, I started to see =, == and === operators. What's the difference between them?
I'm used to programming in C and C++, mainly for embedded and sometimes for computer apps. I would like to explore a new and more modern language. Rust, V lang and Zig seem to be good candidates. ...
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...
In eclipse (java) Window->Preferences->Java->New new templates can be created. In the field "Pattern" I entered System.out.println("DEBUG ${label}"); ${cursor} I like old-style debug...
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...
Not sure if this is the right place to ask, but I am trying to understand the reported theoretical performance of tensor cores on NVIDIA GPUs. Taking the H100 SXM5 as example, the reported peak pe...
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...
