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 am migrating a WPF app to WinUI3. Things went well until I needed to put a combo box in the datagrid. That MS had removed the datagrid from the standard tools was overcome with Community Toolkit ...
Background + Example Code Let's say I have a SwiftUI ViewModel like so: class ViewModel: ObservableObject { @Published var strs: [String] = [] func fetchStrs() async { // T...
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...
We use Kubernetes on a cloud (GKE, to be precise). We use RabbitMQ for messaging and we need to upgrade it from 3.10 to 3.12 . FWIW RabbitMQ has been added to our system using a chart from Bitnami...
I'm trying to write a spec test for a (correctly working) Angular component, but it errors when calling a service method with: TypeError: _this.myService.getSomeData is not a function The service...
I'm trying to use this code with Axios: import "./feed.css"; import Post from "../post/Post"; import Share from "../share/Share"; import { useState, useEffect } from "react"; import axios from...
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'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...
Unlike docker, Podman won't (understandably) use docker hub by default. You can use it explicitly like this: (just using a random example here, it's an OpenAPI linter) podman pull docker.io/dshanl...
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...
Suppose you have a jinja template like this: I am going to {{ foo }} to get some {{ bar }}. I hope I can find: {% for i in baz %} - {{i}} {% endfor %} This template will require you to pass ...
Is there a way in Ubuntu to run a given bash command for a given Key combination in Gnome (42.9)? I run an Ubuntu in Hyper-V and after a while the normal Keyboard layout change doesn't work (maybe...
Say I've made a bunch of changes to a file and would like to split those changes into two or more commits. Normal git add however stages the whole file in one go. So how to add only some of the ch...
Let's say I have a client/server application with a data structure on the server side: type User = { name: string; superSecretGovernmentIdNumber: string; }; These fields are both non-nul...
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'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 trying to set the transform attribute of a group within an SVG. Specifically, I'd like to set translate's value to 0 0. I tried using the set element for this but that didn't have an observab...
Context: I have a varchar column in a segment event table that contains version numbers. Most of these are formatted nicely as X.Y.Z (major.minor.patch) where X, Y, and Z are integers. However, the...
NOTE The meaning of the word "program" below is (PROGRAM) A federal or state initiative that offers grants for non-profits so that they can provide service at low cost or free of charge. a...
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...
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...
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 move the main branch back to an earlier commit in git?
In VS Code, is it possible to run Python code on the text being edited? I realize that I can save my text, create a .py file, switch to a terminal (including VS Code's own terminal) and run the .p...
VS Code supports regex search, but the search/replace is UI is just a tiny dialog box. It's okay if you know regex well and the expression is not complex, but when trying to apply complicated expre...
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 ...
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...
I'm trying to replace Flot.js with Chart.js. In my application, Flot.js is included as a normal JavaScript file, like so: <script language="javascript" type="text/javascript" src="jquery.flot-...
I am writing some scripts that operate on emails in Maildir format. A lot of things are easy in this format, but the filenames are absolutely incomprehensible. For example, one script moves mails ...
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...
A page is very slow and laggy in Firefox. I am certain it's one of the many Javascripts slowing it down. Out of curiosity, I'd like to figure out which script is creating the heaviest load. Note t...
Is there a way to easily insert today's date when editing a file in VS Code?
If I run ls() in R, it shows the variables (including functions) in my workspace. But there are other variables visible too, e.g. functions from packages like ls itself. And if I write a function...
I've figured out that code --new-window /foo/bar/baz.txt will open baz.txt in a new window. But when I do this, it says "no folder opened" in the file explorer pane. That makes it hard to work with...
I am currently working with LWJGL and the obstacle I face right now on my project is rendering textures to a cube, e.x a set of 8 vertices with position, color, and UV information. For now, I am st...
I'm writing a library "MyLibrary". In there, I group code into sections that make sense. Let's say I have a folder "Reports" and a folder "Helpers". I would like to have my code separated while ...
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...
When developing a rust program you build and run using cargo run. However you cannot just append arguments to that as they will be caught (and likely rejected) by cargo itself. So how to pass argum...
How to delete a local git branch which hasn't been pushed to anywhere, and only exists locally?
When reading about various operators used by programming languages, the term "short circuit behavior" is often used. For example in this C code: int a = 0; a && b++ Someone explained t...
One way to remove element from array is to replace element with zero. Below is a rough snippet I am sharing: int N = sc.nextInt(); int pos = sc.nextInt(); int A[] = new int[N]; if(pos == i) { ...
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...
Consider this code example: def example(param=[]): param.append('value') print(param) When example is repeatedly called with an existing list, it repeatedly appends to the list, as ...
I have a large and complex PostgreSQL SELECT query that I would like to make faster. EXPLAIN suggests it should run quickly, with the worst parts being scans of a few thousand rows. When run, it do...
Is there a Python serialization format that has capabilities similar to Pickle, but is text based? The problem I always have with pickle is that it's binary, so I can't manually view or edit the d...
I need help figuring out if my dependencies need upgrading or conflict with each other. I tried using the command prompt to solve problems but it didn't help. Here is my code. Android Studio Iguan...
I need to do a lot of calculations involving sets. There are relatively few values in the "universe" of candidates that could appear in any of the sets, but potentially very many such sets (they mi...
I have a few different projects that rely on open source technology that I wish to make modifications to (say, to add key features for business or personal use) that will vary between upstreamable ...
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...