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)
How can I turn uniform samples of unsigned n-bit (n=16/32/64) integers (over the whole range of integers) into uniform samples of n-bit IEEE floats in [0, 1]? By uniform, I mean the continuous unif...
I'm trying to write a bash function that can sanitize filenames to make them compatible with both Linux and Windows file systems. The function should perform the following operations: Replace in...
I'm trying to set the transform attribute of a group within an SVG. Specifically, I'd like to set translate's value to 0 0. I tried using the set element for this but that didn't have an observab...
Do Scala's match types support full spectrum dependent types, and if not, what capabilities do they lack?
I’m working on a Python project that’s starting to grow, and the code is becoming harder to manage as different responsibilities are mixed together. Are there any recommended ways to organize modul...
Master lists like 82 food subreddits and 128 tech subreddits don't indicate each's subscribers. if it's private. Sometimes moderators can make the sub private for several days, to clean i...
Has anyone written a constant-time BigInteger modular multiplication function in Java? I need to use modular multiplication for a cryptographic protocol, and I don't want to try to write it myself ...
One of the fonts available (to me) on Google Docs is "Caveat". The following is in 18-point Caveat on Google Docs: I found that Caveat is available at https://github.com/googlefonts/caveat/t...
I'm new to D and am planning to use it for golfing. I want to make a ROT13 converter and I want to determine the length of an inputted string. Is there a function for this? If not, what ways can I...
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'm trying to compile the program texstudio with git clone [email protected]:texstudio-org/texstudio.git cd texstudio mkdir build cd build cmake .. cmake --build . Since the update to xcode 2...
I am trying to use Django's default select widget to render an HTML dropdown. I have this code: in models.py: class VehicleYear(TimeStampedModel): oem_year = models.IntegerField( un...
I'm running Python 3.14 in Linux. I have script with a breakpoint() in it, so when I run $ python my_script.py, it will take me into the (Pdb) prompt. Then, if I want to exit, I type q or do CTRL+D...
I have the following scenario (in MySQL 8): CREATE TABLE `steps` ( `id` int NOT NULL AUTO_INCREMENT, `number` varchar(30) DEFAULT NULL, `parent_number` varchar(30) DEFAULT NULL, `timestamp` ti...
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Capa_1" x="0px...
In Vim command-line mode, I can run :set invnumber to toggle line numbers on/off. Is there a way to run this command using the $ vim --remote-expr {expr} shell command? I know I can do this using $...
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)...
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...
Suppose you have a largish git repository with many files of different types (both text and images) distributed among a number of nested directories. Parallel development has occurred on two branc...
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...
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: ...
