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.
Search
You can use MutationObserver Quick example, disconnect logic is not mandatory and could be improved: const container = document.querySelector('.CategoryTreeResult'); let disconnectTimeout; ...
Some comments and your answer are doing this: document.body.innerHTML = document.body.innerHTML.replace(/x/g, '*'); But as explained in the comments, this is not a good solution, because it can...
Editing one's profile on codidact is problematic. Evidently it needs to be 30 characters or more, but there's no error message, there's just a red box around the profile post and then the save but...
While writing the question I did find one hacky solution which works, and which I will use unless someone has an alternative. Create a codebehind file for the theme: using System; using System.W...
There are several ways to turn a recursive algorithm into an iterative one or at least avoid to do the recursive calls in your own code. In the specific example of yours, where your traverse a tre...
I was tasked with an assignment where I should get a box to move to the 4 corners of the viewport by hovering on a button. Most of the code is already finished except for figuring out how to get th...
One problem of your code is the one that @celtschk already has reported: You start one child process, and that one child process does the area calculation exactly once. Thus, one step towards the ...
@InfiniteDissent gives an excellent explanation why such a feature would be problematic from a programming language design perspective. As a consequence, C++ is defined such that the code you wan...
I am working with VS 2022 and trying to make a WPF MVVM application. The application updates the items displayed in the datagrid, persisting the changes to the database upon save. However, adding a...
It can't be done with git-send-email(1), but there's a tool that integrates with it, and is very simple to use: patatt(1). Install the tool: $ sudo apt-get install patatt And then for each rep...
I am using linq/EF core to retrieve data via an API call. How do I sort the collection of related data for each retrieved entity? Assume the following structure: an Order is made on a certain da...
When I implemented this for a code golf challenge, the state had to encode not only the vertex you were at but the edge by which you had entered (or, equivalently, the direction in which you were f...
Caesar Cipher originally deals only with letters (ASCII "A" to "Z", without diacritics/accents), so I'm not sure why you included €§$%& in your answer. And using indexOf (as you did) is not ver...
It may be hard to find in the docs, but you can use mruby in H2O to rewrite URLs: https://h2o.examp1e.net/configure/mruby.html Unlike Apache, you can use an actual programming language to do the ...
Benchmarking is hard and there are a lot of potential issues with your code. I agree with Olin Lathrop that you want at least a few seconds worth of run time, not just due to the potential for a lo...
I found a form I wanted to duplicate on a roof construction website. All my input boxes are centered except the last one that's a bit off and I cannot figure out why. Here is my code: HTML <...
I have some code connecting to an active directory via ldap. Something like this: public Response add(User user) { try { LDAPConnectionPool ldapPool = ldapConnectionPool.getPool();...
I'm trying to implement bases and overlays for some Kubernetes configurations that I have, but I'm running into an issue where labels and annotations are not being applied correctly to some specifi...
This works for me in both bash and zsh on Debian 12. I can't guarantee it will work the same on every platform and shell. EDITOR=echo git config --global --edit 2>/dev/null or, if you prefer...
(Brought over from SE.) The following code implements a simple interface to operate on mutable* Strings in C. It is composed of two files: one for the structure definition and the available oper...
I have two vps: First one is used for vpn/proxy. It runs 3x-ui that, simply saying, allows to create and manage vpn/proxy with UI. VPS' ip is connected to https://new-york.vpn.utils.example.co...
There are a few fields that play into this, but the gist of it is to set the Pod's restartPolicy to Never. This doesn't mean that the Job only tries once. Rather, instead of restarting the containe...
(Brought over from SE.) This is a Bash script that copies files stored inside disk images to a directory, using a defined structure provided via a JSON file. I've included the external programs ...
Note that, by declaring sh as the language, you have implicitly declared "a # introduces a comment", because that's what is implied by the sh syntax. But you say you don't want that interpretation...
This question was originally asked in SE. I have a program that draws lines using line drawing algorithms. I use gcc 5.2.1 on Xubuntu 15.10 to compile it. Executing it throws a "Segment violati...