Image

Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

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)
50%
+2 −2
Uniform floating point from unsigned integer

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...

1 answer  ·  posted 15d ago by deleted user  ·  last activity 6d ago by Monica Cellio‭

integer floating-point sampling
50%
+2 −2
How to write a bash function to sanitize filenames for Linux and Windows

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...

1 answer  ·  posted 2y ago by ShadowsRanger‭  ·  last activity 7d ago by jaalto‭

bash
77%
+5 −0
Set transform of SVG element

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...

2 answers  ·  posted 2y ago by Matthias Braun‭  ·  last activity 13d ago by Robert Longson‭

svg
66%
+2 −0
Do Scala's match types implement full dependent types?

Do Scala's match types support full spectrum dependent types, and if not, what capabilities do they lack?

1 answer  ·  posted 13d ago by deleted user  ·  last activity 13d ago by r~~‭

scala dependent-types
50%
+0 −0
How should I structure a growing Python project?

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...

3 answers  ·  posted 22d ago by deleted user  ·  last activity 14d ago by psychicganeshbaba‭

python
27%
+1 −6
How can software track [1] how many subscribers to subreddits, [2] if subreddit is private, [3] if submissions are restricted? [closed]

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...

1 answer  ·  posted 5y ago by TextKit‭  ·  last activity 15d ago by Karl Knechtel‭

reddit
57%
+2 −1
Constant-time modular multiplication library in Java?

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 ...

1 answer  ·  posted 16d ago by skye‭  ·  last activity 15d ago by Derek Elkins‭

java
80%
+6 −0
How does character/glyph replacements in fonts like "Caveat" work?

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...

1 answer  ·  posted 5y ago by msh210‭  ·  last activity 16d ago by Alexei‭

google-fonts fonts
66%
+4 −1
How to get string length in D?

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...

3 answers  ·  posted 4y ago by General Sebast1an‭  ·  last activity 20d ago by hkotsubo‭

string function d
75%
+4 −0
Generating a better looking family tree-style graph in Python

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 ...

1 answer  ·  posted 2mo ago by pycoder‭  ·  last activity 21d ago by bowl0stu‭

python charts python-3 graphviz mermaid
77%
+5 −0
cmake looking for files from a previous SDK

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...

2 answers  ·  posted 5mo ago by samcarter‭  ·  last activity 24d ago by samcarter‭

macos
57%
+2 −1
Why won't Django render its select widget with this code? [closed]

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...

0 answers  ·  posted 28d ago by redlinecodes‭  ·  closed 27d ago by Karl Knechtel‭

python django django-widget
77%
+5 −0
how to disable Python pdb's Quitting pdb will kill the process. Quit anyway [y/n]? prompt

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...

0 answers  ·  posted 30d ago by Trevor‭

python debugging
71%
+3 −0
Conditions which always matches returns no result with CTE

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...

2 answers  ·  posted 4y ago by artaxerxe‭  ·  last activity 1mo ago by marcothesane‭

mysql common-table-expression
36%
+2 −5
Why margin isn't working in SVG for path?

<?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...

1 answer  ·  posted 4y ago by Anonymous‭  ·  last activity 1mo ago by herrstrietzel‭

svg margin
77%
+5 −0
how to run Vim's :set command using vim --remote-expr

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 $...

1 answer  ·  posted 1mo ago by Trevor‭  ·  last activity 1mo ago by Derek Elkins‭

vim
66%
+2 −0
Macro to verify that an expression has no side effects at compile time

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)...

1 answer  ·  posted 1mo ago by alx‭  ·  last activity 1mo ago by Lundin‭

c gcc c-preprocessor
66%
+2 −0
Python-compatible regex for Markdown tables

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...

2 answers  ·  posted 1mo ago by pycoder‭  ·  last activity 1mo ago by hkotsubo‭

python regex markdown python-3
88%
+14 −0
What is the general process for merging two git branches, reviewing edits on each branch?

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...

3 answers  ·  posted 1y ago by SystemExplorer‭  ·  last activity 1mo ago by Michael‭

git
71%
+3 −0
Standard for hierarchical sitemaps

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...

0 answers  ·  posted 1mo ago by Matthew‭

sitemap
72%
+6 −1
How to avoid pushing past commits when making a pull request?

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?

1 answer  ·  posted 4mo ago by Ooker‭  ·  last activity 2mo ago by Michael‭

git github pull-request
71%
+3 −0
Link to Markdown line on Bitbucket

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...

1 answer  ·  posted 2mo ago by Michael‭  ·  last activity 2mo ago by John C‭

bitbucket
71%
+3 −0
Python http.server how can I programatically refresh the browser page?

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...

2 answers  ·  posted 2mo ago by pycoder‭  ·  last activity 2mo ago by jimbobmcgee‭

python python-3 pyqt6 pyqt
75%
+4 −0
Why Does My Azure OpenAI Deployment Occasionally Return a '429 Too Many Requests' Error Even When I Am Under the Documented Rate Limits, How to solve?

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...

1 answer  ·  posted 3mo ago by MariaAllen‭  ·  last activity 2mo ago by MariaAllen‭

azure
77%
+5 −0
How to capture packets bound from/to solely one application?

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...

1 answer  ·  posted 2mo ago by Mr. Beedell, Roke Julian Lockhart (RJLB)‭  ·  last activity 2mo ago by Mo_‭

linux port
80%
+6 −0
Project's name from command line

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...

4 answers  ·  posted 3mo ago by deleted user  ·  last activity 2mo ago by Riven Skaye‭

python
80%
+6 −0
What's the difference between =, == and === operators in JavaScript?

While learning JavaScript, I started to see =, == and === operators. What's the difference between them?

3 answers  ·  posted 4y ago by Kevin M. Mansour‭  ·  last activity 2mo ago by VLAZ‭

javascript operators
42%
+1 −2
Alternative embedded language: Rust, V, Zig [closed]

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. ...

0 answers  ·  posted 2mo ago by AdriZ‭  ·  closed 2mo ago by Lundin‭

rust compiled-language zig embedded vlang
60%
+1 −0
Setting icon with javaFX does not show in task list

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; ...

0 answers  ·  posted 2mo ago by watchmaker‭

java linux javafx
66%
+2 −0
Creating PDF from HTML on Debian Bookworm; tools?

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...

2 answers  ·  posted 3mo ago by plain_toast‭  ·  last activity 3mo ago by Alexei‭

*nix
60%
+1 −0
eclipse templates -- creating and setting a permanent variable

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...

0 answers  ·  posted 3mo ago by watchmaker‭  ·  edited 3mo ago by Lundin‭

Eclipse
71%
+3 −0
Java: ignore warnings from generated code

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...

0 answers  ·  posted 3mo ago by watchmaker‭

java code-generation javacc
60%
+1 −0
How can I run Flux2 inference on 2 GPUs?

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(): ...

0 answers  ·  posted 3mo ago by Franck Dernoncourt‭

python gpu huggingface-transformers
50%
+0 −0
eclipse: change toString to prettyPrint

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...

0 answers  ·  posted 3mo ago by watchmaker‭

Eclipse
80%
+6 −0
How to add a percent_jitter strategy to backoff Python package and pass extra args in the decorator?

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...

1 answer  ·  posted 4mo ago by ShadowsRanger‭  ·  last activity 3mo ago by Alexei‭

python
77%
+5 −0
java.time.ZonedDateTime missing seconds in output

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...

2 answers  ·  posted 3mo ago by watchmaker‭  ·  edited 3mo ago by watchmaker‭

java datetime
62%
+3 −1
What happens if I activate a python venv inside another venv?

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?

1 answer  ·  posted 3mo ago by deleted user  ·  last activity 3mo ago by Karl Knechtel‭

python python-venv
80%
+6 −0
GitHub action triggered by somebody else's repository

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...

2 answers  ·  posted 4mo ago by samcarter‭  ·  last activity 3mo ago by Michael‭

github
71%
+3 −0
Python re.sub() how to include and slice the match in the substitution?

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...

2 answers  ·  posted 4mo ago by pycoder‭  ·  last activity 3mo ago by Alexei‭

python regex python-3
71%
+3 −0
How to compute the peak performance of GPU tensor cores?

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...

0 answers  ·  posted 3mo ago by mr Tsjolder‭

computer-science gpu cuda hardware
50%
+0 −0
How do I fix LNK1104: cannot open file 'ncrypt_provider.lib'?

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'

1 answer  ·  posted 3mo ago by riQQ‭  ·  last activity 3mo ago by riQQ‭

c++ windows
66%
+2 −0
Method not found when emitting a custom signal, but the game seems to work when played.

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...

1 answer  ·  posted 2y ago by TecBrat‭  ·  last activity 4mo ago by Alexei‭

godot gdscript
71%
+3 −0
How to pipe grep(1) and use compatible exit codes?

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-...

1 answer  ·  posted 4mo ago by alx‭  ·  last activity 4mo ago by watchmaker‭

bash grep error-handling
40%
+0 −1
[How] can I escape all markup characters in CommonMark source?

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...

0 answers  ·  posted 4mo ago by Mr. Beedell, Roke Julian Lockhart (RJLB)‭

html escaping software-recommendation
60%
+1 −0
Tackling net::ERR_NAME_NOT_RESOLVED and timeout error on browser object creation when using Puppeteer

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 {...

1 answer  ·  posted 4y ago by sbirl‭  ·  last activity 4mo ago by Alexei‭

node.js puppeteer timeout
66%
+2 −0
Helm delete old release revisions

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...

1 answer  ·  posted 1y ago by Iizuki‭  ·  last activity 4mo ago by Alexei‭

kubernetes helm
66%
+2 −0
How to use Python/pytest to organize unit and system tests?

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...

1 answer  ·  posted 4mo ago by anatolyg‭  ·  last activity 4mo ago by Karl Knechtel‭

python unit-testing pytest
60%
+1 −0
How can I export a full Scryfall search to a CSV compatible with Moxfield collections?

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 ...

2 answers  ·  posted 4mo ago by ShadowsRanger‭  ·  last activity 4mo ago by Alexei‭

python
42%
+1 −2
Python script using gitignore_parser doesn't respect .gitignore rules [closed]

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...

0 answers  ·  posted 4mo ago by ShadowsRanger‭  ·  closed 4mo ago by Karl Knechtel‭

python gitignore
75%
+4 −0
Java generics, how to work around type erasure?

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: ...

1 answer  ·  posted 4mo ago by watchmaker‭  ·  edited 4mo ago by hkotsubo‭

java generics