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)
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...
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...
Since setState is asynchronously executed, how to dynamically do something after a useState variable has been set? Consider import { useState } from "react"; const [myVar, setMyVar] = useState("...
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...
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 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...
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 ...
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...
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...
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...
callPackage is a complex function (reasons include the Nix language being lazy, usage of fixed-point evaluation, overrides, etc.), and this complexity steals the spotlight from what this function a...
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...
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, ...
I have an "tensorflow.python.framework.ops.Graph" object loaded from a .pb file. def load_pb(path_to_pb): with tf.compat.v1.gfile.GFile(path_to_pb, "rb") as f: graph_def = tf.compat....
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...
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...
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 vscode, when I hit a breakpoint it automatically opens "Run and Debug" window. I don't want that because I am using a small screen (and that sidebar takes up space) and I don't always need to us...
Say I have two functions: FILE* get_input(const char fname[static 1]); FILE* get_output(const char fname[static 1]); And I wish to declare a function pointer and assign it the result of some p...
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...
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 site hosted through GitHub and I'm using footers for special links and it also serves as my main navigation bar for now. I find it a little frustrating to manually copy-paste the footer's ...
I heard git pull is dangerous. Is it really dangerous? If so, why or how is it dangerous? Are there any flags that mitigate or remove the danger? What are the alternatives if it...
I'm trying to implement pytest for one of my Python Flask projects. The application is instanciated like this in appname.py def create_app(): app = Flask(__name__) app.config.from_pyfil...
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 -...
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 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 Box drive on Windows. I use it as a regular folder on the computer. I can store images there. When I store a small number of images (on the order of a couple hundreds) and I do not wait lon...
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...
In older C and C++ standards, the auto keyword simply meant automatic storage duration. As in the compiler automatically handles where the variable is stored, typically on the stack or in a registe...
I am fairly certain this isn't a duplicate so please bear with me. I check for boolean true||false using if() as a matter of course in my programming. I've programmed extensively in PHP, some in C...
Is there a standard way to add an IDistributedCached in front of a database using EntityFramework? Something that handles checking the cache for reads, updating the cache on writes, and uses distri...
I'm trying to containerize a SvelteKit application that uses the @sveltejs/adapter-node. The Build and Deploy section from the documentation recommends to build the application, and then run the a...
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?
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 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 ...
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...
I tried installing package-installation-test[1] using Pip, and it appeared to be successful. But I can't use it as advertised, either by itself or by importing it from my code: Failed attempts ...
I am using a W25Q64 flash ic to store some stuff for an ESP-32 project. I used this library from Github as it seems intended for ESP. It seemed weird that the read function uses two 16-bit paramet...
One of "my" Android apps is showing a heavy frequency of "slow exit" application-not-responding (ANR) problems. The Play Console has the "insight": Slow exit Problem The main thread has finish...
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 know that I can make Python code run starting from the script, but this still requires the user to have Python installed (and will still rely on configuring the system so that it can find Python ...
Recently, Python updated from 3.11 to 3.12 and now all my libraries are gone. Actually they're in the old 3.11 site-packages, but now that python points to 3.12 those are not active. Every time I r...
Having some trouble with giraffe-template on Mac M1, so decided to set up a Giraffe project manually. Started following the Doing it manually section of the Giraffe README, but got stuck right away...
There's not always a Spark cluster on hand to test Spark code. Is there some simple program that you can install locally, which has the same behavior as Spark (can run normal Spark scripts) withou...
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...
When you try to do a privileged systemd operation without the privilege, you get an escalation prompt: $ systemctl stop docker ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ==== ...
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...
One of my applications has a dependency on a stb-library. Now I am publishing this application to Github. Should I: Include the header that was used during development with the code? Have an in...