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)
Mathematically, the purpose of a function is to return an output. However, in a programming context functions often have side effects. It is even common to call functions for the side effects alone...
The answer for this question is that there is something wrong with the expression of the first guard of this function below: congratulations :: [(String, Int)] -> [String] congratulations [] =...
I have a function that loads JSON data and is declared to return a dictionary with string keys and values of any type (Dict[str, Any]). However, mypy is raising an error stating that I am returning...
I'm trying to do some DOM manipulation in jQuery, but am having issues with creating wrapper elements. For some reason, prepending to the wrapper doesn't work after I call wrap. Code <html>...
I have a flat list where each item is the key and value for an attribute. I want to transform this into a nested list where each attribute is a sublist. Example input: [ "attr1 apple 1", "a...
The dictionary methods .keys(), .values(), and .items() all return view objects. Said objects reflect any changes to the underlying dictionary. This is often useful. Is there a way to get such a v...
I've seen macros use parentheses to enclose its arguments. Most of these make sense, as in #define sum(a, b) ((a) + (b)) The outer prevents the following: #define sum_bad(a, b) (a) + (b) ...
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've my go app the is running a web API and working smoothly at my laptop. I read this and completed the IIS setup using a config file: <configuration> <system.webServer> ...
There may be a better way to manage website's with JavaScript deployments. I added jest to my repo simply to execute tests when I make PRs as part of a GitHub action. This requires a package-lock.j...
I've created a code snippet in "functions.php" that should add another product to your cart if you mark the checkbox, but somehow, only the original product is add (like the single product from the...
I am looking for a way to programmatically edit and save .dbc files that are meant for J1939 CAN communication. I have a few large files that need to be compared/edited. Being able to import, edit...
The answer provided in the How to set the cell color to a user defined value using NPOI from F#? thread solves the problem of how to set the right properties using F#, but it uses a new ICellStyle ...
Background Many Python programs now recommend installing with pipx, and there is a sense that you shouldn't install with pip anymore, you should use tools like pipx. Main Question However, what ...
I need to pass URI's that contain special characters, using Spring Boot. The characters include spaces, curly braces ({ and }), square brackets ([ and ]), and hash signs (#). The problem is that ...
I am attempting to use the chartjs-zoom-plugin v2.0.1 with Chart.js v4.4.0. I have the plugin as the file chartjs-plugin-zoom-2.0.1.min.js, and I have imported it into my page using <script ty...
I am in need of downloading some files (from dynamic list of URLs) and archive them into a single zip file. Since these files can be arbitrarily sized (totaling hundreds of MB), I want to avoid dow...
What I would like to do I would like to try to build a language model 100% from scratch if possible, for a learning experience. That means no external libraries and no pre-curated datasets. It ...
How to use static functions in ColdFusion? How to import component? How to call a static function using both tag and script syntaxes? Adobe added support for static functions in ColdFusion...
Taking the example from this Stackoverflow question: type Vector2D(dx : float, dy : float) = static let zero = Vector2D(0.0, 0.0) static let onex = Vector2D(1.0, 0.0) static let ...
I'd like to get the minimum and maximum values of the axes on a Chart.js 4.4.0 plot. When the plot is created, these values must be calculated somewhere. However, reading through the Chart.js doc...
I have written a screensaver program that, in part, uses the current wallpaper for some visual effects. However, finding the current wallpaper in different operating systems and environments is les...
Consider the following arbitrarily-nested JSON as input to a jq filter: echo '[{"foo": [1, 2]}, {"bar": [{"baz": ["foo", "baz"]}]}]' | jq '.' My goal is to join leaf arrays into strings: [{"fo...
TL;DR Is (a and b) equivalent to tf.logical_and(a, b) in terms of optimization and performance? (a and b are tensorflow tensors) Details I use Python with Tensorflow. My priorities are Make t...
I have created a tag in my project, using git tag v2023 However, I forgot to commit a few changes. Now I would like to move this tag to the current point (after having committed the changes I had...
Flutter supports packaging a SQLite instance with a Flutter app using the Sqflite plugin. I do not like the speed of SQLite or the fact that it does not enforce column datatypes and want to use som...
When I run code . in a directory, Visual Studio Code opens two windows. The first is empty, the second shows directory I was in as expected. I checked ~/.config/VSCode/Workspaces and there is only...
For a UI gadget like a $link in Factor, a click automatically opens the page that it points to. I want to know where this default behaviour is defined. In the factor documentation, there are many ...
The Zip class from Data.Zip requires an implementation of Semialign: class Semialign f => Zip f In my mind: Zip takes the intersection of two shapes. Semialign takes the union of two sha...
It's not possible to send data to amazon prime and disney+hotstar. I was trying to send user to amazon prime when they click a (video) link (e.g. https://www.amazon.com/gp/video/detail/B01MSPI8JN/r...
In JSON Schema one can use the additionalProperties key to validate properties whose names are not know. You can still impose restrictions on their type. How to do this in an Ansible role argument...
Found the example below in a book teaching logical database design, but I'm stuck on how one would implement this in PostreSQL: The diagram reflects the following business rule: An instructor...
How to make Husky run git hook? I have a working git hook, prepare-commit-message, but the moment Husky was installed, the hook stopped working. Not finding much luck, I then tried to make it a "H...
When I set up my object mappings with SQLalchemy, everything works well enough. It even creates the tables for me if they don't exist. However, if I decide to add/remove columns (aka fields) from ...
Note: this is based on my question on SO and subsequent activity there I am trying to add resilience using Polly to HTTP calls that are performed using Refit library. I am using the Refit factory...
I have a Python program like this: done = False while u and not done: i = u.pop() print(f"Processing {i}") do_big_task(i) finish_up() Since this takes a long time, the user m...
TL;DR: How to pass a interpolated double vector, such as a dvec2, from the vertex shader to the fragment shader? I have a vertex shader. In this the output variable out vec2 uv; is set. And i have...
--- Here is the error message. Traceback (most recent call last): File "c:\Users\19185\Documents\GitHub\Chatty\Chatty\one_.py", line 3, in import azure.cognitiveservices.speech as speechsdk Mo...
In a Qt application I have nothing more than a window with a button as its direct child. I set its background color and all is fine: Window::Window(QWidget *parent) : QWidget(parent) { but...
I have the following code: use serde::{Deserialize, Serialize}; #[derive(Sereialize, Deserialize)] struct Container<const SIZE: usize> { contents: [String; SIZE] } But I'm getti...
When you do: cd /some/path code . VS Code opens with that location shown in the "Explorer" sidebar. However, the state of the file tree and the currently open files will be the same as what wa...
Is it valid to partly allocate an object, as long as you only use the allocated part of it? #include <stdio.h> #include <stdlib.h> struct s { int i[100]; }; int main(void) {...
Is it possible for a Python program to send itself in the background? For example, on Linux you can do nohup some_cmd & and any program will run in the background. Some programs also support s...
What factors should be considered when choosing web security measures for a site?
I'm using the os.rename function in a lua script. It works perfectly fine for renaming files on my hard drive, e.g. os.rename("test.txt","/Users/username/Desktop/test2.txt") will rename the fil...
char *p, *q; p = malloc(1); free(p); q = p; // lvalue conversion Is the last lvalue conversion (= p;) Undefined Behavior or not? We didn't take the address of the local p. C11::6.3.2.1...
I want to pass a variable to TeamCity (on prem) to choose between deployment environments (there are 14 of 'em - don't ask) when running a TC deployment configuration build which uses a PowerShell ...
The current project I am working on consists of a bunch of microservices (Web APIs) accessible only internally using Entra ID (formerly Azure ID). To simplify the development, all services expose ...
How to move the main branch back to an earlier commit in git?
I have an application that works with a JTable, and in this JTable, I want each cell to have both an ImageIcon and some text. I see at this link, JTable supports ImageIcon OR text, but seemingly n...