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
How do you implement polymorphism in C?

The topic of how to implement polymorphism in C tends to pop up now and then. Many programmers are used to OO design from higher level languages and supposedly OO is a "language-agnostic" way of pr...

1 answer  ·  posted 16h ago by Lundin‭  ·  last activity 16h ago by Lundin‭

77%
+5 −0
Differences between Haskell tools Stack and Cabal?

Haskell tooling can be confusing. Both Stack and Cabal appear to be build tools with similar goals. How do they differ? Why should you pick one over the other?

1 answer  ·  posted 20d ago by Iizuki‭  ·  edited 17h ago by Alexei‭

60%
+1 −0
I can't install the Spacy library using the terminal in VSCode on Windows 10

I am trying to install the Spacy library in VSCode in a folder with a virtual environment. The output appearing in the terminal is excessively long; I will share it with a pastebin later. My versio...

1 answer  ·  posted 1d ago by Richard‭  ·  last activity 18h ago by Richard‭

66%
+2 −0
Multiple versions of scala libraries detected!

While compiling my scala project I'm getting following error. org.scala-lang.modules:scala-parser-combinators_2.13:2.4.0 requires scala version: 2.13.13 org.scalatest:scalatest_2.13:3.2.19 requ...

0 answers  ·  posted 6d ago by talex‭

66%
+2 −0
ffmpeg script outputs video with unexpected resolution and frame rate despite scaling and fps filtering

I'm having trouble with an ffmpeg script that's supposed to convert videos to a specific resolution and frame rate, but the output video has unexpected dimensions and frame rate. Here's my script a...

2 answers  ·  posted 18d ago by ShadowsRanger‭  ·  last activity 6d ago by harmony‭

55%
+3 −2
Which platforms return a non-null pointer on malloc(0)

What is the portability of malloc(0);? Which platforms return NULL without setting errno? Which platforms return a non-null pointer? Do any platforms have some other behavior?

2 answers  ·  posted 17d ago by alx‭  ·  last activity 6d ago by harmony‭

50%
+0 −0
Hexagonal Architecture + Domain Driven Design. How to perform a correct implementation?

Hello! Currently, I am trying to implement these two architectures together with Java and Spring (although technology shouldn't matter I think). But I'm encountering problems getting them to work...

1 answer  ·  posted 7d ago by rudahee‭  ·  last activity 6d ago by harmony‭

77%
+5 −0
make: How to compile all files in a directory.

I am learning how to write makefile to compile a c program. I have a directory structure like this: . ├── include │   └── library.h ├── lib │   └── library.c ├── makefile └── obj My makef...

1 answer  ·  posted 7d ago by Vanity Slug ❤️‭  ·  last activity 7d ago by Vanity Slug ❤️‭

81%
+7 −0
Why not call nullptr NULL?

In C++11 the nullptr keyword was added as a more type safe null pointer constant, since the previous common definition of NULL as 0 has some problems. Why did the standards committee choose not to...

2 answers  ·  posted 14d ago by user253751‭  ·  last activity 7d ago by alx‭

66%
+2 −0
How to mock methods like `pathlib.Path.is_dir`?

I used to have some testing code for mocking a simple directory structure when working with pathlib. I recently tried to run these tests to learn that some of the internals in pathlib have changed ...

1 answer  ·  posted 9d ago by mr Tsjolder‭  ·  last activity 8d ago by mr Tsjolder‭

66%
+2 −0
Unable to use conditional Must term in C# NEST client for Elastic Search

I'm trying to write a Elastic Search query using the C# NEST client, but right now I'm stuck on an issue with a conditional query. The query takes in two optional values, meaning they are both all...

1 answer  ·  posted 1mo ago by hest‭  ·  last activity 10d ago by hest‭

71%
+3 −0
How can I get the same "not all control paths return a value" behaviour across Clang and MSVC?

I've recently discovered that it's not actually an error to have control reach the end of a non-void function without returning anything, it's merely undefined behaviour. I want to promote the rele...

2 answers  ·  posted 1mo ago by Hyperlynx‭  ·  last activity 10d ago by celtschk‭

40%
+0 −1
Webpack can't recognize modules

I've got errors Uncaught TypeError: setting getter-only property "todo" and Uncaught TypeError: lib is undefined. I assume that those errors appeared when I created a new module for local sto...

0 answers  ·  posted 12d ago by Sevenfold‭  ·  edited 12d ago by Sevenfold‭

50%
+1 −1
How to create Factory Functions instead of using Classes

Instead of classes, I want to use factory functions. Original code with classes: export class MyProject { constructor(title, description, dueDate, priority) { this.title = title; ...

0 answers  ·  posted 16d ago by Sevenfold‭  ·  edited 12d ago by Andreas lost his angel wings‭

77%
+5 −0
C#: Performance hit from using calculated property instead of get-only property with initializer?

JetBrains Rider suggests that I change this (for example): public class Foo { public int OnePlusOne { get; } = 1 + 1; } to this: public class Foo { public int OnePlusOne => 1 + 1...

0 answers  ·  posted 15d ago by LyndonGingerich‭

66%
+2 −0
What does an exclamation mark mean in a GraphQL schema?

Types are often followed by exclamation marks in GraphQL schemas. What do they mean? type User { id: Int! email: String! name: String! updatedAt: String! createdAt: String...

1 answer  ·  posted 19d ago by Iizuki‭  ·  edited 19d ago by Alexei‭

71%
+3 −0
Unit Testing #define Directives in Visual Studio

I have some methods in my codebase that utilize the #if DEBUG preprocessor directive to provide specialized behavior that differs between the debugging environment and the production environment. I...

1 answer  ·  posted 21d ago by Orladdin‭  ·  last activity 21d ago by Olin Lathrop‭

50%
+0 −0
Using sqlline, how do you filter/find tables using the !tables command

I need to filter/find and list tables using the sqlline !tables command. For example, these are the type of queries i wish to fire Find out all the tables in a particular schema s1 All tables ...

1 answer  ·  posted 21d ago by Abbas Gadhia‭  ·  last activity 21d ago by Abbas Gadhia‭

70%
+5 −1
How to detach my terminal window from a program ran from it? [closed]

I want to run a program, e.g. Firefox, from terminal, but whenever I close the terminal, program closes too. How to detach my terminal window from a program ran from it?

1 answer  ·  posted 23d ago by kujaw‭  ·  closed 22d ago by Alexei‭

77%
+5 −0
Json deserialization of enum, forbid int

I have a DTO that contains an enum field: @Getter @Setter static class Foo { Bar bar; } enum Bar { X, Y } When I deserialize a JSON, it allows int as values: var objectMapper ...

2 answers  ·  posted 24d ago by talex‭  ·  edited 23d ago by hkotsubo‭

66%
+2 −0
SQL scripts referenced in persistence configuration must have each statement on its own line

I'm currently working on a Java application using Jakarta Persistence with EclipseLink and PostgreSQL. While setting up the application to test the database layer, the persistence configuration is ...

0 answers  ·  posted 25d ago by ɯıpɐʌ‭  ·  edited 24d ago by ɯıpɐʌ‭

71%
+3 −0
How to format Markdown in terminal

When printing Markdown text to the terminal, how can I get a bit more formatting so it looks nicer? I realize that this is a bit of a contradiction, since terminals generally use only one font. Bu...

1 answer  ·  posted 3mo ago by matthewsnyder‭  ·  last activity 28d ago by Michael‭

66%
+2 −0
Filter stashes by pathspec

The documentation for git stash list says list [<log-options>] List the stash entries that you currently have. Each stash entry is listed with its name (e.g. stash@{0} is the latest entry...

0 answers  ·  posted 7mo ago by Michael‭  ·  edited 28d ago by Michael‭

66%
+2 −0
VSCode go is confused about what version of Go I have installed

I'm trying to work with a Go project that I'm taking over from another developer. The go.mod file says I need at least version 1.13, and I have 1.22.3 installed according to go version. However, wh...

0 answers  ·  posted 1mo ago by Andrew Ray‭  ·  edited 1mo ago by Alexei‭

81%
+7 −0
Map<?, Optional<T>> to Map<?, T>

I have a Map with Optional values. I want to filter it to remove empty values. Map<K, Optional<T>> input; Map<K, T> result = input. // here is some code I'm looking for ...

2 answers  ·  posted 1mo ago by talex‭  ·  last activity 1mo ago by hkotsubo‭

71%
+3 −0
Execute SQL queries stored in a table

Let's say I have a table with SQL statements in a column. I want to execute them all. create table sql_command( sql_text text ) I know how to execute one SQL statement using EXEC, but I wa...

1 answer  ·  posted 1mo ago by talex‭  ·  edited 1mo ago by Michael‭

66%
+2 −0
Why is package.json needed for running a SvelteKit application?

I'm trying to containerize a SvelteKit application that uses the @sveltejs/adapter-node. The Build and Deploy section from the documentation recommends to build the application, and then run the a...

0 answers  ·  posted 1mo ago by ɯıpɐʌ‭

60%
+1 −0
Identifying non-daemon threads in an Android ANR stack dump

One of "my" Android apps is showing a heavy frequency of "slow exit" application-not-responding (ANR) problems. The Play Console has the "insight": Slow exit Problem The main thread has finish...

0 answers  ·  posted 1mo ago by Peter Taylor‭

71%
+3 −0
multi-arch code fails on mingw 64bits

I have a C/++ codebase that compiles in Windows x86_64 targeting x86 using the mingw32 32-bit shell of the MSYS64 project. (It also compiles fine on linux x86/x86_64 and android's 4 archs.) Howev...

0 answers  ·  posted 2mo ago by JohnRando‭  ·  edited 1mo ago by JohnRando‭

81%
+7 −0
Why is the new auto keyword from C++11 or C23 dangerous?

In older C and C++ standards, the auto keyword simply meant automatic storage duration. As in the compiler automatically handles where the variable is stored, typically on the stack or in a registe...

2 answers  ·  posted 3mo ago by Lundin‭  ·  last activity 2mo ago by celtschk‭

71%
+3 −0
Prevent anonymously subclassing

Is it possible to somehow prohibit anonymously subclassing of a specific class? For instance, with a plain public parent class: public class Parent { } Extending this class should not be pos...

1 answer  ·  posted 3mo ago by Andreas lost his angel wings‭  ·  last activity 2mo ago by Antares‭

66%
+2 −0
Turn all changes after latest origin/main into a branch

I have a git history that basically looks like this: * commit: XXX (HEAD -> main) | | * commit: YYY | | * commit: ZZZ (origin/main) | | ... Now I would like to turn everything after...

2 answers  ·  posted 2mo ago by celtschk‭  ·  last activity 2mo ago by matthewsnyder‭

git
57%
+2 −1
What actually is a pytest fixture?

Pytest uses fixtures. Their docs explain what fixtures do: https://docs.pytest.org/en/stable/explanation/fixtures.html But what actually is a fixture? Is there a definition for it? Is this a term ...

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

66%
+2 −0
Spring Boot application not excluding Jdbi bean when running tests using WebFluxTest

I have a simple Spring Boot 3.x reactive application that exposes a RESTful API. The application uses Jdbi in the persistence layer, and the configuration for Jdbi is straightforward: @EnableTrans...

0 answers  ·  posted 2mo ago by ɯıpɐʌ‭

77%
+5 −0
How can I git checkout the previous HEAD?

After switching to a different branch, git checkout - can move me back to the branch I came from. This is handy for times when I wonder "wait, what was that last branch again?" But this does not w...

1 answer  ·  posted 2mo ago by matthewsnyder‭  ·  last activity 2mo ago by hkotsubo‭

git
60%
+4 −2
Is `git pull` dangerous?

I heard git pull is dangerous. Is it really dangerous? If so, why or how is it dangerous? Are there any flags that mitigate or remove the danger? What are the alternatives if it...

2 answers  ·  posted 2mo ago by alx‭  ·  last activity 2mo ago by alx‭

git
66%
+2 −0
How can I interact with the target widget from a drop event

I'm trying to update a ListBox widget after dropping some files on it. This is the relevant part of my current code: fn on_file_drop(target: &DropTarget, value: &Value, ...

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

50%
+0 −0
STM32: read data in device sent by host over USB HID

In an STM32CubeIDE USB HID project for an STM32F103C8 board I can send data from the device to the host using the USBD_HID_SendReport() function, like so: USBD_HID_SendReport(&hUsbDeviceFS, (u...

0 answers  ·  posted 2mo ago by etale_cohomology‭

66%
+2 −0
how can I run pytest on Flask routes?

I'm trying to implement pytest for one of my Python Flask projects. The application is instanciated like this in appname.py def create_app(): app = Flask(__name__) app.config.from_pyfil...

0 answers  ·  posted 2mo ago by GeraldS‭  ·  edited 2mo ago by GeraldS‭

77%
+5 −0
Reusing HTML without rewriting it

I have a site hosted through GitHub and I'm using footers for special links and it also serves as my main navigation bar for now. I find it a little frustrating to manually copy-paste the footer's ...

3 answers  ·  posted 3mo ago by General Sebast1an‭  ·  last activity 2mo ago by matthewsnyder‭

71%
+3 −0
What does Nixpkgs' `callPackage` do?

callPackage is a complex function (reasons include the Nix language being lazy, usage of fixed-point evaluation, overrides, etc.), and this complexity steals the spotlight from what this function a...

1 answer  ·  posted 2mo ago by toraritte‭  ·  edited 2mo ago by toraritte‭

66%
+2 −0
How to execute and find gradients of a tensorflow (1) graph object

I have an "tensorflow.python.framework.ops.Graph" object loaded from a .pb file. def load_pb(path_to_pb): with tf.compat.v1.gfile.GFile(path_to_pb, "rb") as f: graph_def = tf.compat....

0 answers  ·  posted 2mo ago by purplenanite‭

71%
+3 −0
Why does a lack of object encapsulation constitute a security breach?

In the current version of OpenJDK's JEP 401: Value Classes and Objects (Preview), it is said that value classes can leak data stored in their fields, and that this is potentially a security concern...

1 answer  ·  posted 2mo ago by Andreas lost his angel wings‭  ·  last activity 2mo ago by Derek Elkins‭

71%
+3 −0
How to establish a relationship between HTML elements (tags)? (i.e., how can one element refer to another one)

Should I use the data-* attributes for this or is there a more idiomatic way? For context, I'm trying to convert annotated legal PDF documents to HTML. Certain parts of these documents are cross...

3 answers  ·  posted 3mo ago by toraritte‭  ·  edited 2mo ago by Karl Knechtel‭

66%
+2 −0
Is this AES/CBC scheme, where the IV does not need to be known during decryption, insecure or does it have any other disadvantages?

Usually a random IV is used for encryption with AES in CBC mode, so that key/IV pairs are not reused, which would be a vulnerability. During decryption, the IV of the encryption is required. If de...

1 answer  ·  posted 2mo ago by Holden‭  ·  last activity 2mo ago by Peter Taylor‭

60%
+1 −0
How can I create and modify a struct over iterations of a loop?

How can I have a mutable object (for example a vector) that is created inside a loop iteration and needs to be updated in later iterations of said loop? As a concrete example, consider parsing som...

2 answers  ·  posted 3mo ago by GeraldS‭  ·  last activity 2mo ago by GeraldS‭

28%
+0 −3
libicuin75.dll was not found

At this time I am trying to manually install doxygen into msys64 but the computer I am using does not have access to the internet. When I try to start doxywizard.exe, I am receiving this error. ...

2 answers  ·  posted 3mo ago by john1726‭  ·  last activity 2mo ago by Nisha Jadon‭

80%
+6 −0
After git fetch, how to fast forward my branch?

I did git fetch to quickly get latest commits. I did this instead of git pull so I could deal with merge conflicts offline. But my repository is still stuck on the old commit, and now git pull fail...

2 answers  ·  posted 3mo ago by matthewsnyder‭  ·  last activity 3mo ago by Michael‭

git
60%
+1 −0
Cannot use import statement outside a module when integrating Carbon Design System (Web Components) in Svelte

I'm working on a Svelte web application. The issue I'm having is when I'm trying to integrate the Carbon Web Components module. I installed the module using npm install --save @carbon/web-component...

0 answers  ·  posted 4mo ago by ɯıpɐʌ‭  ·  edited 3mo ago by Alexei‭

75%
+4 −0
Why does `tkinter` (or `turtle`, or IDLE) seem to be missing or broken? Isn't it part of the standard library?

I had understood that Python is supposed to come "batteries included", and that the "batteries" specifically include: the tkinter standard library, a simple GUI framework a simple IDE cal...

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