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)
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 ...
I have text (xml actually) files. Some files contain 'foo', some contain 'bar', some contain neither and some contain both. It's the both I'm interested in. How do I do an AND search on words in...
I have an Android 10 device where the OS is unlocked but the bootloader is not. I can't obtain the unlock code through the normal channels because of bureaucratic incompetence. Given that the devi...
I am working on a React Native app using Realm, Atlas Flexible Sync, and MongoDB, and I'm super confused about how subscriptions work. I'm coming from a .NET SQL background, so I'm completely new t...
#ifdef sections can, of course, be used to include or exclude chunks of code based on some criteria known at compile time. One big problem is that when the condition is evaluated to false, the chun...
I'm trying to revive an old project of mine. It was built with Phalcon PHP 2 or 3 (I don't even remember which version, but quite old). There I could include a call to the loop inside the controll...
Ansible's extract filter is supposedly made for use in map, but at the time of writing the documentation doesn't actually show how to use it together with the map filter. The following outputs VAR...
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...
I'm trying to flatten a repository of Python code into a Markdown file where each file is formatted like: relative/path/to/file1.py # contents of file1.py I'm using this command: find . -name...
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...
My Android app needs to process lists that contain nullable elements. I am using JUnit 4.13.2 for unit testing. I am using Android Studio Flamingo | 2022.2.1 Patch 2 . I have a failing test,...
I am working on a toy project where I have a container for which I would like to write an iterator that iterates over the values in the container. Because the values are stored in a (c-style) arra...
Suppose I have an Azure Synapse Serverless SQL database. I can run the following to get the sid of added groups: select name, type_desc, authentication_type_desc, sid from sys.database_principal...
Note: I asked this question on TopAnswers a couple weeks ago, but didn't get any response, so I figured I'd ask it here. I am currently learning C++. I have a parent class (Vehicle) and two subc...
According to this article: Since encryption is two-way, the data can be decrypted so it is readable again. Hashing, on the other hand, is one-way, meaning the plaintext is scrambled into a uniqu...
I have to implement a JSON based REST web service for querying literature. Ordinary users should be able to query data and process it in their clients. The "main user" can adapt database entries vi...
(Full code available for cloning here) I've run into some odd behavior of EF-core's Find method. It seems like the returned entity doesn't include the rest of the data. MWE Models using Micro...
I'm experiencing an issue where my program appears to freeze when executing the post_comments_to_lemmy function. This function fetches comments from the GitHub API and posts them to a Lemmy instanc...
A well-known easter egg in Python displays some ideas about writing good Python code, credited to Tim Peters (one of the core developers). This question is about the last: Namespaces are one hon...
A friend is involved in rewriting a distributed software application and while discussing the architecture, we noticed that in many cases the messages had duplication between headers and payload. ...
Sometimes code needs to assign (or otherwise use) a value that depends on some condition. The naive approach is to use explicit branching, which in Python would look like: if some_condition(): ...
I have git repo where the .git is deleted. I didn't realize it until after I made some changes to the code. I want to re-create the .git by cloning. However I don't want it to touch the files that...
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...
How to verify if a year is leap? Given a numeric value (such as 2023) or some object that represents a date (such as Date, Calendar, LocalDate, etc), how can I do it?
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...
Functions in C have external linkage by default. In other words, the storage class specifier extern is applied to functions by default, with the effect that they are visible to all translation unit...
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...
Question How can I read data from a NestJS Redis Cache as a stream? I'm using Nest.js and its @nestjs/cache-manager (using the Redis implementation), I need to read data I have stored in the cach...
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'm looking at the behaviour of Chrome and my test framework and trying to understand what the correct behaviour should be before raising an issue/ticket on one or the other (or revisiting how my t...
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 ...
Context I am currently migrating a Web application from on-prem infrastructure to K8s. The legacy infrastructure relies on defining some tokens in the configuration files and these are replaced d...
I am writing a Python package where I have two classes in different files that (indirectly) depend on each other. If I wouldn't care about type-hints, there would be no problem, but unfortunately,...
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 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...
Amazon product URLs are often very long, but on experimentation it is revealed that the following pattern is sufficient: https://www.amazon.com/{dp|gp}/$ID ID is a 10-char string, which I'm gue...
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...
I'm evaluating JetBrains Rider 2023.3 on Linux and almost immediately ran into a compiler warning that I don't understand. Attempting to isolate it, I created a new solution containing a .NET 6 cla...
I do need to create an email template using components where the wrapped text left side (td - 50%) is overlapping with the image ( td - 50%) like Venn Diagrams... Not exactly but somehow... I came...
I believe when you sign in with Google, the web application running in your browser calls a command to request the Google Sign In page, and includes a “callback URL” as a parameter in that HTTP req...
I'm trying to create an automatic text-to-link conversion feature in a TypeScript application. The desired workflow is: Copy a URL to the clipboard Select some text Paste the URL - this should...
I use git submodule foreach git pull to update my submodules. There's quite a few and it appears that foreach is updating them one by one, instead of in parallel. How can I do it in parallel?
Background The coefficient of variation is: defined as the ratio of the standard deviation to the mean Question Is there a built-in function for this? Tried I know I can do df.std() / df...
For example, given this function head, this is the hint that is generated: let updateCell workbook sheetIndex rowIndex columnIndex value = // XSSFWorkbook -> int -> int -> int -> stri...
How to move the main branch back to an earlier commit in git?
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...
print() normally adds text to STDOUT, it does not erase existing text. https://linux.codidact.com/posts/289869 describes various ways of doing the overwrite in shell scripts. How can you do this ...
Working with dbt version 2 I'm trying to set up source checks but I'm running into an issue where the column names I'm setting tests for have dashes (e.g. my_table.some-field-with-dash). I current...
Hi, I'm trying to code an Enigma machine in Haskell which were used by the German in WWII to transmit coded messages. An Enigma Machine consists of 3 rotors which are substitution ciphers and a re...