Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

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)
66%
+2 −0
Log4j2 not looking for log4j.properties even with the system property set

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 -...

1 answer  ·  posted 9mo ago by tarhalda‭  ·  edited 9mo ago by Alexei‭

71%
+3 −0
Adding elements to wrapper after calling wrap doesn't work

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>...

1 answer  ·  posted 1y ago by Moshi‭  ·  last activity 1y ago by Mithical‭

60%
+1 −0
How to solve the "ReferenceError: service is not defined"?

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, ...

1 answer  ·  posted 9mo ago by Oleg Valter‭  ·  last activity 9mo ago by Oleg Valter‭

71%
+3 −0
How can I output / display multiple values, with controlled spacing, without building a string?

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 ...

1 answer  ·  posted 9mo ago by Karl Knechtel‭  ·  last activity 9mo ago by Karl Knechtel‭

60%
+1 −0
How to set the cell color to a user defined value using NPOI from F#?

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...

1 answer  ·  posted 3mo ago by toraritte‭  ·  last activity 3mo ago by toraritte‭

62%
+3 −1
How do I remove an element from a Java array?

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) { ...

1 answer  ·  posted 7mo ago by abhinavxyz‭  ·  edited 7mo ago by E_net4‭

81%
+7 −0
Git add/stage only part of a file's changes

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...

1 answer  ·  posted 6mo ago by Iizuki‭  ·  last activity 6mo ago by Iizuki‭

git
75%
+4 −0
How to make Husky run git hook?

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...

1 answer  ·  posted 10mo ago by LAFK‭  ·  edited 10mo ago by Alexei‭

80%
+6 −0
How to use function composition for applying a function to first elements of a list?

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 :...

2 answers  ·  posted 9mo ago by mr Tsjolder‭  ·  last activity 9mo ago by mauke‭

71%
+3 −0
Is it possible to get the current function in a trace function?

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...

1 answer  ·  posted 12mo ago by luser‭  ·  last activity 12mo ago by r~~‭

75%
+4 −0
Why does `Zip` require `Semialign`

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...

1 answer  ·  posted 2mo ago by WheatWizard‭  ·  last activity 2mo ago by r~~‭

60%
+1 −0
What can be used in react-native instead of an html label tag to achieve the same result?

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...

0 answers  ·  posted 9mo ago by andre‭  ·  edited 9mo ago by andre‭

81%
+7 −0
What is the purpose of grouping the tests in a `tests` module and is it possible to split them?

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...

3 answers  ·  posted 1y ago by ShadowsRanger‭  ·  last activity 9mo ago by Moshi‭

77%
+5 −0
Lemmy API: how to get list of followed/subscribed communities.

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 ...

1 answer  ·  posted 10mo ago by elvis_depresley‭  ·  last activity 9mo ago by tgxn‭

66%
+2 −0
Is there a correct way to fetch data with a SwiftUI ViewModel?

Background + Example Code Let's say I have a SwiftUI ViewModel like so: class ViewModel: ObservableObject { @Published var strs: [String] = [] func fetchStrs() async { // T...

0 answers  ·  posted 6mo ago by MrDevel0per‭  ·  edited 5mo ago by MrDevel0per‭

77%
+5 −0
What is the purpose of having underscored names and then defining a non-underscored alias to it?

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...

1 answer  ·  posted 5mo ago by 90 98‭  ·  last activity 5mo ago by aghast‭

75%
+4 −0
Set transform of SVG element

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...

1 answer  ·  posted 6mo ago by Matthias Braun‭  ·  edited 6mo ago by Matthias Braun‭

svg
22%
+0 −5
AttributeError: module 'azure.cognitiveservices.speech' has no attribute 'VoiceProfile' [closed]

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...

0 answers  ·  posted 3mo ago by KunningFox‭  ·  closed 3mo ago by Alexei‭

83%
+8 −0
Git-ignoring files with special characters in their names, especially newlines

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...

1 answer  ·  posted 5mo ago by Karl Knechtel‭  ·  last activity 5mo ago by Peter Taylor‭

80%
+6 −0
Why is git merge from rather than to?

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...

4 answers  ·  posted 8mo ago by matthewsnyder‭  ·  last activity 8mo ago by hkotsubo‭

86%
+11 −0
Git: How to clone only a few recent commits?

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.

2 answers  ·  posted 8mo ago by matthewsnyder‭  ·  last activity 8mo ago by hkotsubo‭

71%
+3 −0
Strict aliasing rules and function boundaries

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) ...

1 answer  ·  posted 1y ago by alx‭  ·  edited 1y ago by Lundin‭

60%
+4 −2
How to speed up MySQL query?

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 ...

2 answers  ·  posted 5mo ago by erenlerhakan‭  ·  last activity 5mo ago by ArtOfCode‭

50%
+1 −1
Rest service doesn't find @GET Method (Jersey Rest service in Gradle).

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...

0 answers  ·  posted 1y ago by Gagamelius‭  ·  edited 1y ago by Alexei‭

28%
+0 −3
How would I go about chunk loading around player in a 3 dimensional cartesian coordinate space [closed]

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 ...

1 answer  ·  posted 1y ago by cuzzo‭  ·  closed 1y ago by cuzzo‭

66%
+4 −1
How to overwrite lines of STDOUT in Python?

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 ...

2 answers  ·  posted 7mo ago by matthewsnyder‭  ·  last activity 6mo ago by hkotsubo‭

77%
+5 −0
Are there technical reasons to pick one struct coding style over the other?

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 ...

1 answer  ·  posted 2mo ago by Lundin‭  ·  last activity 2mo ago by Lundin‭

66%
+2 −0
Advanced Regex extension for VS Code

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...

0 answers  ·  posted 7mo ago by matthewsnyder‭

50%
+0 −0
Adding two products into cart with help of a checkbox.

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...

0 answers  ·  posted 7mo ago by gft‭  ·  edited 7mo ago by gft‭

50%
+0 −0
Embedding other controller-action with Phalcon

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...

0 answers  ·  posted 8mo ago by posthy‭  ·  edited 8mo ago by Alexei‭

85%
+10 −0
What is C23 and why should I care?

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...

1 answer  ·  posted 8mo ago by Lundin‭  ·  last activity 8mo ago by Lundin‭

c c23
50%
+1 −1
Angular Testing fails with Service.method is not a function

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...

0 answers  ·  posted 6mo ago by mcalex‭

60%
+1 −0
Optimized representation for sets?

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...

1 answer  ·  posted 7mo ago by Karl Knechtel‭  ·  last activity 7mo ago by Karl Knechtel‭

81%
+7 −0
How do I add functionality to the back button?

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...

1 answer  ·  posted 9mo ago by Ullallulloo‭  ·  edited 9mo ago by Ullallulloo‭

84%
+9 −0
Understanding mutable default arguments in Python

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 ...

4 answers  ·  posted 7mo ago by Karl Knechtel‭  ·  last activity 5mo ago by matthewsnyder‭

75%
+4 −0
Is there any rationale for the lack of local constants in PHP?

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...

0 answers  ·  posted 2mo ago by klutt‭

php
66%
+2 −0
VS Code can't find node installation due to dynamically setting the PATH

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...

0 answers  ·  posted 9mo ago by Moshi‭

66%
+2 −0
How can I get a value as a node:stream from the Nest.js cache-manager?

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...

0 answers  ·  posted 6mo ago by gdfelt‭  ·  edited 6mo ago by MrDevel0per‭

22%
+0 −5
Solution E-Commerce de Paiement [closed]

Salut, quelle solution de paiement e-commerce avec 0% de commission me proposerez vous ?

0 answers  ·  posted 1y ago by Bicano‭  ·  closed 1y ago by Monica Cellio‭

75%
+4 −0
Wikidata: How do I ask for the start date of a property in SPARQL?

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 ...

0 answers  ·  posted 4mo ago by wasuko‭

50%
+3 −3
Regex for simplifying Amazon product URLs

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...

1 answer  ·  posted 7mo ago by matthewsnyder‭  ·  last activity 7mo ago by mr Tsjolder‭

22%
+0 −5
Replit particles push instead of being background [closed]

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...

1 answer  ·  posted 1y ago by ObviousPlays‭  ·  closed 1y ago by Alexei‭

81%
+7 −0
How to verify if a year is leap in Java?

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?

1 answer  ·  posted 1y ago by hkotsubo‭  ·  last activity 1y ago by hkotsubo‭

33%
+0 −2
Axios error bad request [closed]

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...

0 answers  ·  posted 6mo ago by AyeshSoul‭  ·  closed 6mo ago by Alexei‭

60%
+1 −0
How do I install Chart.js as a file?

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-...

1 answer  ·  posted 7mo ago by CavanWright‭  ·  last activity 7mo ago by Ullallulloo‭

66%
+2 −0
Using Lua's `os.rename` to rename a file from a hard drive to a new location on a USB flash drive

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...

1 answer  ·  posted 1y ago by samcarter‭  ·  last activity 1y ago by Peter Taylor‭

75%
+4 −0
Is it possible to re-export types similar to JS?

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 ...

1 answer  ·  posted 7mo ago by raphaelschmitz‭  ·  last activity 5mo ago by raphaelschmitz‭

c#
50%
+1 −1
How do I properly render a quad in OpenGL using a GL_TRIANGLE_STRIP primitive?

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...

1 answer  ·  posted 7mo ago by cuzzo‭  ·  last activity 7mo ago by djm‭

66%
+4 −1
Does Python have a "ternary operator" (conditional evaluation operator like "?:" in other languages)?

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(): ...

2 answers  ·  posted 5mo ago by Karl Knechtel‭  ·  last activity 5mo ago by matthewsnyder‭

75%
+7 −1
Automatically install all packages needed

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...

3 answers  ·  posted 10mo ago by matthewsnyder‭  ·  last activity 8mo ago by meta user‭