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'm completing the rustlings exercises as part of self-teaching Rust. While working on the third iterators exercise, I solved the exercise but don't quite understand why my solution works. Specifi...
C offers two different styles when it comes to structs (and union/enum too). Either declare them using a struct tag only ("struct tag style"): struct my_type { ... }; struct my_type x; Or ...
In a C implementation in <stdio.h> on Linux I saw something like: extern FILE *__stdinp; extern FILE *__stdoutp; extern FILE *__stderrp; And then: #define stdin __stdinp #define stdou...
GitHub has a setting wherein they offer to "anonymize" your user email from, say, somebody@example.com to somebody@users.noreply.github.com. I presume this is to prevent you from getting spam from ...
Some development tools provide an error message when a user tries to import two things (classes, packages) with the same name. Some programming languages offer a syntax to import one of those thing...
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 ...
I have a parent div with two child divs. I want the parent div and the child divs to have a blue background color when it's hovered. But the child divs doesn't inherit the background color. It is o...
The question is about libraries that extend the data type system to ensure physically realistic computations. Think std::chrono but for distance and mass and other things as well as for time. Inste...
What exactly is the Python Global Interpreter Lock (GIL)? As someone who is relatively new to Python, is this something I need to be aware of, or is this just some implementation detail of the inte...
On branch-x, I do git merge branch-y Now there are some conflicts, and git status shows Changes to be committed: new file: a new file: b Unmerged paths: (use "git a...
I am using MediatR in an ASP.NET Core 3.1 application and I want use a generic query and a generic request that deals with getting lists of some standard items I am using in drop-downs and similar:...
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/tree/ma...
Its possible to execute a MySQL file from the command line like so, mysql -u USER -pPASSWORD < FILENAME which triggers a warning, mysql: [Warning] Using a password on the command line int...
I was told by my professor/book that computer programs use two kinds of memory and that all variables get allocated either on the stack or on the heap. Is this true? How can I tell where a variable...
For holding ordered sets of keys, there are well-known data structures (the red-black tree, for example) that support O(log(n)) lookup and insertion algorithms. Of course this means that there triv...
I have JSON that looks something like this: {"id":"n-fsdf-6b6", "name":"JohnSmith", "revisionDate":1591072274000} The JSON data is named CharacterInfo. It comes from a static external URL. The str...
If one is using SASS to build a websites CSS and using version control one can either, Keep both the SASS and the resulting CSS files in version control. Only storing the SASS files in version con...
Let's say I have a table with 10,000 rows and instead of selecting all of the rows at once I select 1,000 at a time like LIMIT 0,1000 LIMIT 1000,1000 etc. Without an ORDER BY statement the or...
I'm writing a JSON schema to validate asset files for a program. The JSON I need to parse is structured so: { "jobs": { "software-developer": { "job-description": "sw-dev.md:0", "pay": 800...
While learning JavaScript, I started to see =, == and === operators. What's the difference between them?
What I want: An object that contains a function that I can update after creation. I created a struct that contains a parameter b and a function(closure?) named Internal_Fn. struct MyThing { ...
When I run pip install foo, pip looks for foo in PyPi. I want it to look for it first in a private repo, let's say pypi.bar.com. Only if foo cannot be found in pypi.bar.com, should pip then look f...
Let's say we have an object, we store it in a union (into some other narrower type, but with memcpy(3), so it's allowed --I guess--), and then read it from the union via it's original type (so no a...
The proposed library would sit alongside cross-platform libraries in Xamarin apps for iOS and Android. However, it would include files with names like MyLibraryFile.android.cs MyLibraryFile.ios...
Perl is by far the language I have the most experience with, and I have (big) parts of the functionality I want in the new program in existing programs. So I'm looking for a way to do this in perl,...
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...
Context I have started working on an Angular upgrade for a medium-sized project (from v. 10 to v. 15) and this is a rather long activity that is interrupted by other changes that need to be perfor...
Context Using the lemmy API, I'm trying to get a list of sublemmies (lemmy communities) that a user is following. Reading the documentation, I using the /site endpoint, I should be able to get a ...
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...
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...
Let's say I have a variant that can hold a bunch of different types of values (say I got them from parsing a JSON or similar). using Value = std::variant<std::monostate, int, double, std::strin...
Say we have an abstract class Foo declared as so: class Foo { public: virtual void test() = 0; }; Let's say that we make a derived concrete class FooDerived, and decide to mark it's ve...
I have a Makefile in my Jenkins job's workspace, that I want to edit out certain parts from and then save it, before running next part of the script that uses this Makefile. The part that I want t...
Is it legal ISO C to declare a function as noreturn with a non-void return type (but of course not actually returning)? As far as I can read from the standard, it seems legal. Example: noreturn ...
What (if anything) does the C standard have to say about linking objects? My guess is that, because C only defines language->behavior rules, it completely ignores any potential intermediate form...
Suppose I am using a Java API from Kotlin and I want to call a function that takes a FloatArray (represented as float[] in Java), and I have an Iterable<Float> as my input data type. To be mo...
I have an array that I need to clone in Angular / Typescript. That is, any change done on an element from the cloned array should not affect the content of the initial array. How can I achieve thi...
Issue I have recently discussed with a friend a performance issue he and his colleagues have encountered in an ASP.NET Core 5 application (a checkout app, microservices architecture). The problem...
This is based on a code review discussion that I had with a colleague about the way I have designed the resources paths for an ASP.NET Core controller that is currently consumed only internally (by...
We use Jenkins Pipeline to build and test some C++ software. The pipeline script runs the tests on 10 different nodes in a parallel way in order to save time. All of these nodes are real (not virtu...
Let's say I have some collection of data. My goal is to provide different kind of view of ItemsControl depending on user`s preference. For simplicity, we can assume that user can select only betwe...
I have this bootstrap code (grid) <div class="container p-3 center"> <div class="row"> <div class="bg-light border-bottom border-secondary border-top col-6 te...
One of the recent business requirements is to be able to search through a list of entities using a bunch of filters. Most of these filters allow multiple values and the user might theoretically pro...
Preface: This is a self-answered Q&A meant as a C string handling FAQ. It will ask several question at once which isn't ideal, but they are all closely related and I'd rather not fragment the p...
I have an Angular application. The frontend has a mechanism that periodically fetches some information like this: ngOnInit(): void { setInterval( () => { this.http.get(... ).sub...
As far as I can tell, it is in part determined by the HTML spec's History API1, specifically the value of history.scrollRestoration. Quoting the HTML spec's scroll restoration mode paragraph: ...
Suppose I have some code in a file myscript.py like: def my_function(): print("Test") What steps do I need to take in order to make my_function run? That is to say: how do I get Python to ...
According to the standard (C17 draft, 7.22.3.2) The function calloc void *calloc(size_t nmemb, size_t size); "allocates space for an array of nmemb objects, each of whose size is size [and] i...
Found an article about starting a repo with an empty commit. Read the post a couple of times, but still don't understand the reasoning: 1. git log and other commands blow up with terrifying ...
I want my CLI Python program to schedule a task, and then exit. After some times has passed (say 10 minutes) the task should execute. The task can be a Python method or a shell command, whatever i...