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 an application from Log4j1 to Log4j2 using the API bridge jar. All references to the log4j1.jar have already been removed. I set the system property in Websphere as a JVM argument -...
I'm trying to do some DOM manipulation in jQuery, but am having issues with creating wrapper elements. For some reason, prepending to the wrapper doesn't work after I call wrap. Code <html>...
Temporary notice: this is part of an ongoing project of transferring and splitting my canonical from Stack Overflow on common errors in Google Apps Script. As soon as the Q&As are finalized, ...
I know that I can display a single string in the terminal window like print("example") (or similarly with a string in a variable), and I know how to open text files and write to them. I also know ...
As far as I can tell (from F# at least), cell can only be colored using predefined NPOI.SS.UserModel.IndexedColors. From the available methods / properties, val it: ICellStyle = NPOI.XSSF.UserM...
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) { ...
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...
How to make Husky run git hook? I have a working git hook, prepare-commit-message, but the moment Husky was installed, the hook stopped working. Not finding much luck, I then tried to make it a "H...
Can anyone explain to me why my Haskell function gives rise to a type-definition error? Originally, I wrote the following function to subtract one from the first n elements in a list: dec_first :...
I'm trying to subclass pdb to have a debugger that, in case of a call to a decorated function, can "step in" the decorated function directly and skip the decorator content altogether. A well-behave...
The Zip class from Data.Zip requires an implementation of Semialign: class Semialign f => Zip f In my mind: Zip takes the intersection of two shapes. Semialign takes the union of two sha...
I wanna make a form in React native. A field in this form in (non-native) React would be like this: <div> <label htmlFor="lastName">Last Name:</label> <input type="text...
What is the purpose of grouping the tests in a tests module like this #[cfg(test)] mod tests { use super::*; #[test] fn test_function_1() { // test code for function 1 g...
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 ...
Background + Example Code Let's say I have a SwiftUI ViewModel like so: class ViewModel: ObservableObject { @Published var strs: [String] = [] func fetchStrs() async { // T...
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...
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...
I need to use azure.cognitiveservices.speech. However I am getting this error: Here is code on replit it produces the same error. https://replit.com/@mystickain420/Chatty main -- https://githu...
My actual motivation is to understand the semantics of the .gitignore file syntax in precise detail, for a program which is expected to emulate them as accurately as possible. However, while coming...
Why does git merge take the source branch rather than the destination branch as a parameter? The most common merge case by far for me is "Okay, this branch looks good, let's merge it into branch X...
How do I clone the repository with only part of the history? For example, let's say I want to download only the last 5 commits out of thousands.
Let's analyze this code, assuming an architecture where the alignment of int64_t is the same as that of double: void bar(double *f, int64_t *j) { *(int64_t *)f = *j; } void foo(void) ...
I have a website about vacation villa rentals. Around 800 properties are listed. When i start a search, i get properties with my first query which filters type, style, area, no. of rooms, capacity ...
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...
So I am in the process of creating a voxel sandbox survival game (minecraft clone) in javaFX. I am at a point where I need to come up with a way to load the chunks in my surrounding given a render ...
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 ...
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 ...
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...
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...
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...
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...
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 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...
How do I add functionality to the back button in Android without reimplementing the back button entirely? Prior to last year, I would just call onBackPressed() and then simply override it: overri...
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 ...
The last few years, PHP has basically exploded with lots of modern language constructs that makes the life easier. But local constants are still missing, and I find that very strange. I have found...
I installed Node.js using NVS to manage my node installations. This works great, except that I haven't been able to figure out how to debug using VS Code. When trying to launch, I receive this err...
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...
Salut, quelle solution de paiement e-commerce avec 0% de commission me proposerez vous ?
I have a SPARQL query to Wikidata that returns the names and handles and parties of politicians for whom a Mastodon address is stored at Wikidata. Filtered by nationality and with an output of the ...
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...
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...
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?
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'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'm using the os.rename function in a lua script. It works perfectly fine for renaming files on my hard drive, e.g. os.rename("test.txt","/Users/username/Desktop/test2.txt") will rename the fil...
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 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...
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(): ...
When running various Python scripts, I often need to do this annoying dance: $ python script.py ... ModuleNotFoundError: No module named 'foo' $ pip install foo $ python script.py ... Module...