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 working on a replit https://AppropriateMessyRoutes.ozabramo.repl.co and I am trying to implement https://github.com/VincentGarreau/particles.js as a background but I keeps on pushing every...
So I just started learning how to use file-streams in C & decided to attempt a question which is to do with library management in C, however I am currently encountering some problems and feel l...
It would seem that the C standard library is a collection of diverse functions that pretty much just ended up in the standard by tradition or "accident", rather than through some careful plan or ra...
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...
There are a lot of articles and presentations that show little love for ORMs. This is mainly because some queries are so complex and heavy on the database that they lead to significant issues in p...
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...
For some reason, I just wanted to undo a commit on my git repository, which I've done with the following command: git reset --soft HEAD~1 So far, so good. However, by mistake I issued the comma...
When reading posts at programming sites such as this one, I frequently encounter people saying things like: "There is no pass-by-reference in C, everything is passed by value." People claiming su...
If I am not mistaken any DOM "tree" node is actually a "branch", which would be an HTML element or perhaps a CSS pseudo-element, of course. If that's true what are the different node types and esp...
What's the better way to store base64 in SQLite Database? I was thinking to put base64 as TEXT since base64 has lots of chars. CREATE TABLE name (id INTEGER PRIMARY KEY AUTO_INCREMENT, image TEXT)...
I have to migrate a bunch of text from an old application into a new one. Some of these texts contain HTML tags and entities (HTML editor was used) and now they do not want to support this in the n...
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> ...
How can I monitor an Angular frontend with Prometheus? I was able to create metrics for my Node.js API using the express-prometheus module. But I can't find any Angular/Prometheus integration. Basi...
This is intended to be a canonical post for this problem which is pretty common. Especially among beginners. I've heard that I should avoid using floating point variables for representing curren...
Credit for User:Meriton for developing the following code (first published here). function replaceIn(e) { if (e.nodeType == Node.TEXT_NODE) { e.nodeValue = e.nodeValue.replaceAll("a", "");...
There is an external program I'm calling from within my C/C++ program, by using fork() and execl(), and redirecting the stdio with dup2() to be able to read the output from the external program. I...
I try to ignore paths in the Codeql code scanning file. But every scan it seems that scanning doesn't ignore these files, do you have any tips?
I started adding types to my (working) solution to Exercism's "Kindergarten Garden" exercise, to learn how typing with python and Mypy (strict) works. While doing so, I ran into a Mypy error that I...
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...
This data tree is comprised of clickable buttons and I want to expose all branches, in a single action, instead of clicking each vertical arrow button anew. I have tried the following code which d...
For someone who was familiar with C++ in the past and is coming back to it after a long break, what are some useful books that won't waste time with basics but will cover the new features of the mo...
I've heard that in modern C++, smart pointers are preferred to raw pointers for ownership (the so-called RAII principle, as I understand it). This makes sense, and since then I've always used them...
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...
So I was looking around for some async solutions and I found one on github, https://github.com/electronicarts/ea-async I follow the setup instructions for maven. Only to realize it didn't work (I ...
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...
Most of the example code in the Zig online docs is in the form of test blocks. Sadly, this means there aren't quite enough examples of how to write functions. Given that one has a readable file, p...
Our team is finally focusing on writing more automatic testing and one of my ex-colleagues recommended to try out the Verify library. The tool does the following: runs the test and compares the...
So im trying to do RUN update-crypto-policies --set LEGACY in my Dockerfile as I was getting an error "Failed to load certificate from file 'client-rsa.pem':''ee key too small". But when I build...
Let's say I have this class I want to mock class A { public void add(T arg) { B b = A.getB(); U val = somefunc(arg); V ret = b.add(val); } } I have a spy o...
If I execute in browser console: document.write("Hello"); A new DOM document with the text Hello appears in the same browser window. From MDN documentation: Note: Because document.write() w...
What does ptr() mean in this code? #include<stdio.h> #include<stdlib.h> void PrintHello() { printf("Hello\n"); } int Add(int a, int b) { return a+b; } int main...
I would like to delete a book from the collection by a particular title from my library if the user enters 2 as input for my switch statement. How can I do that with my current code? #include<...
Based on my last question comes new one. How to loop over 300 000 rows and edit each row string one by one? I have a list of 11-digit numbers stored in one single column in Excel, and I need to s...
How to get image of contact list? I was using cursor to get contact list. Here how it looks like. ArrayList<HashMap<String, String>> contactList = new ArrayList<>(); Has...
I was trying to show transition on activity changes. I had followed two method from SO. I lost those link so I can't add them here. My first method was I had used overridePendingTransition on onCr...
How can I upload images or files to strapi using graphQl. I'm using Cloudinary as the image provider. The strapi admin panel works fine, uploads the images to cloudinary. But, when using graphQl m...
Is it undefined behaviour to cast an uninitialized variable to (void)? Example: int main() { int x; (void)x; return 0; }
I want to enter a string to compare with the text file, and if that word matches, then I want to delete that line containing that string. How can I modify the code below, since the code below take...
For my company, I'm writing naming conventions for embedded code in C language. Function names must be named in lowerCamelCase() and start with a verb. Global variables are in Maj_started_lowe...
Credit for User:Meriton for developing the following code (first published here). function replaceIn(e) { if (e.nodeType == Node.TEXT_NODE) { e.nodeValue = e.nodeValue.replaceAll("a", "");...
MWE import pandas as pd import numpy as np import matplotlib.pyplot as plt df = pd.DataFrame(np.random.rand(9, 4), columns=['a', 'b', 'c', 'd']) df.plot.bar(table=True) # don't want plot, ...
class ExtendUserSession(MiddlewareMixin): """ Extend authenticated user's sessions so they don't have to log back in following 15 minutes (set by Django's default `SESSION_COOKIE_A...
I have recently stumbled across the Maybe (or Optional) modal usage in .NET Code: example code or this one example article Based on everything I read, there are multiple advantages on relyi...
I am caching some very static information (changes once per day) in my ASP.NET Core application. This is normally done when needed ("lazy"). One such cache item is a 50K list of items that are tak...
I noticed when attempting to generate random booleans that t and f are not treated in the same way: t random ! Error f random ! returns a value In the factor 0.98 and 0.99 documentation, t is ...
In Vim, it's possible to tell it to read from stdin instead of a file, by using vim -. This is so that you can pipe the output of one command into Vim, to view/edit it there. The problem I'm facin...
I was playing around with mapped tuples and came across an interesting case where TypeScript cannot infer the types used: interface Foo<A, B> { (a: A, b: B): any } function test<...
I wanted to print to browser console the number of li list items of a given ul list. This didn't work (console output was undefined): console.log(document.querySelectorAll(".example").length); ...
managedQuery is recently deprecated. ManagedQuery was used for using Cursor. What should I use since managedQuery was deprecated? Without it, I can't work with Cursor. So there must be alternative ...