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 did git fetch to quickly get latest commits. I did this instead of git pull so I could deal with merge conflicts offline. But my repository is still stuck on the old commit, and now git pull fail...
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 {...
According to Which functions in the C standard library must always be avoided?, the atoi family of functions is dangerous and should never be used for any purpose. The rationale given in the answer...
In the current version of OpenJDK's JEP 401: Value Classes and Objects (Preview), it is said that value classes can leak data stored in their fields, and that this is potentially a security concern...
In tmux I have the following command in my .tmux.conf, which will save a double-clicked line to the file /tmp/tmux_line.txt: bind-key -n DoubleClick1Pane select-pane \; copy-mode -M \; send-keys -...
Note: This is a general question about Markdown formatting for any Markdown renderer (e.g., Gitlab, Github, Codidact). So this is not just a question about Codidact's renderer. When displaying she...
I run a small website and Im considering blocking proxies and vpns with ipquery to cut back on spam. I keep having bots autofill the contact us even though im using recaptcha. Does anyone have any ...
When I make a separate commit for code cleanup / style changes, I can suppress that commit from git blame so that I can follow a file's history easily without getting distracted by pure style chang...
Many programming languages either have keywords like or and and used for logic, or equivalent operators such as || or && - which are referred to as "logical or" and "logical and" respective...
When doing something simple such as this int a=1; int b=2; int c=3; printf("%d\n", a + b * c); then I was told that operator precedence guarantees that the code is equivalent to a + (b * c)...
I am trying to capture the content outside square brackets in groups, using this regex: (.*)\[.*?\](.*) And it works perfectly for a simple string like this: testing_[_is_]_done This is the...
I'm building a Flask application with user login functionality using Flask-WTF for form handling and Flask-Login for user authentication. However, I am unable to log in successfully. The page does ...
I need to have 2 different models to create projects and to-do lists. I've figured out, that for HTML there is only one dialog menu that can be invoked with window.dialog.showModal(); directly. So ...
I have a generated file that I want Tilt to ignore for re-building. However, when that file changes, Tilt also detects that the parent directory has changed based on its contents changing. I can fi...
These are the methods I know of: Set the form's target attribute to _blank. Add submit event listeners (e.g., this SO thread). In the proprietary web app that I have to work with, every form...
I'm trying to use the "hexagonal architecture" and "domain-driven design" paradigms together, in a Java application using Spring. I understand that my application should have a structure with 3 la...
In C++11 the nullptr keyword was added as a more type safe null pointer constant, since the previous common definition of NULL as 0 has some problems. Why did the standards committee choose not to...
Inspired by https://meta.stackoverflow.com/questions/432242, and the relevant main-space questions. I have heard that C and C++ something called the "strict aliasing rule", which means for exa...
A class might calculate static variables during instantiation, which are then used by various functions. A common technique to optimize function performance is to precalculate expensive variables u...
I would like to have an empty line in the cell of a table in reStructuredText. Consider the following example: .. list-table:: :header-rows: 1 * - aaa - bbb * - ccc - ddd ...
I want to make multiple comparisons at once, of the same type, in a Python program. For example, to check whether all of a certain group of strings are in a longer test string; or whether a specifi...
While trying to understand logical 'or'/'and', I encountered another problem (I'm writing Python code here, but my question is about the logic, not about any given programming language). I have som...
This is a self-answered Q&A meant as a C string handling FAQ. It will ask several questions at once which isn't ideal, but they are all closely related and I'd rather not fragment the post in...
In my desktop application developed in C++, I am encountering an issue where pressing the Ctrl + X, Ctrl + Shift + X, and Ctrl + D shortcut keys triggers a system sound. I would like to suppress o...
This question is adapted from a question I just helped fix up on Stack Overflow. I'm giving a different motivating example which I think will make it clearer what the requirements are and why a n...
Unless I am mistaken, myList.Select(a => a).ToList() initializes the resulting list to the capacity of myList.Count. Does myList.Where(a => true).ToList() do so or does it build up from the i...
I'm trying to make a UWP app in Visual studio, but the NuGet package files have been huge. They just don't fit on my SSD, but I do have an HDD I could theoretically use. After a bunch of tinkering...
I see on https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct/tree/main/onnx: File Name Size model.onnx 654 MB model_fp16.onnx 327 MB model_q4.onnx 200 MB m...
The C language has gone through many iterations and the latest one not yet released is informally called "C23", supposedly because they hoped to release it in 2023. The latest draft version N3096 i...
In my project, I try to fetch data from the backend to display in the frontend using fetch API. Each time I do this I get Cannot read properties of undefined (reading 'map') error. When I check the...
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...
What is the portability of malloc(0);? Which platforms return NULL without setting errno? Which platforms return a non-null pointer? Do any platforms have some other behavior?
Types are often followed by exclamation marks in GraphQL schemas. What do they mean? type User { id: Int! email: String! name: String! updatedAt: String! createdAt: String...
JetBrains Rider suggests that I change this (for example): public class Foo { public int OnePlusOne { get; } = 1 + 1; } to this: public class Foo { public int OnePlusOne => 1 + 1...
I'm working on a background service/daemon for an embedded device, in Rust. The daemon manages several hardware components and these are structured using the Composite design pattern. The composite...
Setup I have a database table with field of JSONB type. I access said database using Hibernate. In hibernate I have entity mapped on said table. Entity contains field marked with @JdbcTypeCode(...
I'm trying to update a ListBox widget after dropping some files on it. This is the relevant part of my current code: fn on_file_drop(target: &DropTarget, value: &Value, ...
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...
Haskell tooling can be confusing. Both Stack and Cabal appear to be build tools with similar goals. How do they differ? Why should you pick one over the other?
While compiling my scala project I'm getting following error. org.scala-lang.modules:scala-parser-combinators_2.13:2.4.0 requires scala version: 2.13.13 org.scalatest:scalatest_2.13:3.2.19 requ...
I'm having trouble with an ffmpeg script that's supposed to convert videos to a specific resolution and frame rate, but the output video has unexpected dimensions and frame rate. Here's my script a...
I am learning how to write makefile to compile a c program. I have a directory structure like this: . ├── include │ └── library.h ├── lib │ └── library.c ├── makefile └── obj My makef...
I used to have some testing code for mocking a simple directory structure when working with pathlib. I recently tried to run these tests to learn that some of the internals in pathlib have changed ...
I'm trying to write a Elastic Search query using the C# NEST client, but right now I'm stuck on an issue with a conditional query. The query takes in two optional values, meaning they are both all...
I've recently discovered that it's not actually an error to have control reach the end of a non-void function without returning anything, it's merely undefined behaviour. I want to promote the rele...
I've got errors Uncaught TypeError: setting getter-only property "todo" and Uncaught TypeError: lib is undefined. I assume that those errors appeared when I created a new module for local sto...
Instead of classes, I want to use factory functions. Original code with classes: export class MyProject { constructor(title, description, dueDate, priority) { this.title = title; ...
I have some methods in my codebase that utilize the #if DEBUG preprocessor directive to provide specialized behavior that differs between the debugging environment and the production environment. I...
I need to filter/find and list tables using the sqlline !tables command. For example, these are the type of queries i wish to fire Find out all the tables in a particular schema s1 All tables ...