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)
30%
+1 −5
How this recursive treewalker works?

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", "");...

3 answers  ·  posted 3y ago by deleted user  ·  last activity 3mo ago by hkotsubo‭

javascript recursion tree tree-traversal
75%
+7 −1
how do I get markdown to render # as a shell prompt and not a comment?

Note: This is a general question about Markdown formatting for any Markdown renderer (e.g., Gitlab, Github, Codidact). So this is not just a question about Codidact's renderer. When displaying she...

2 answers  ·  posted 4mo ago by Trevor‭  ·  last activity 3mo ago by bignose‭

markdown syntax-highlighting
66%
+2 −0
Dynamically do something after a useState variable has been set?

Since setState is asynchronously executed, how to dynamically do something after a useState variable has been set? Consider import { useState } from "react"; const [myVar, setMyVar] = useState("...

2 answers  ·  posted 3mo ago by propatience‭  ·  last activity 3mo ago by bignose‭

reactjs
66%
+2 −0
Labels and annotations not merging for specific resources in overlays

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

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

kubernetes kustomize
83%
+8 −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 9mo ago by matthewsnyder‭  ·  last activity 3mo ago by hkotsubo‭

git
77%
+5 −0
Why utilize an FQDN in the stead of a domain (and/or TLD), relative to the root domain?

Until recently, I'd yet to come across a situation in which I'd had any reason to qualify a DNS namespace further than its TLD. Then, I authored softwareengineering.stackexchange.com/revisions/456...

0 answers  ·  posted 3mo ago by RokeJulianLockhart ‭

dns
66%
+2 −0
Helm delete old release revisions

Helm keeps track of releases and their revisions by creating a kubernetes Secret each time a chart is installed, upgraded etc. These are of course useful in case you want to rollback, but they do p...

1 answer  ·  posted 3mo ago by Iizuki‭  ·  edited 3mo ago by Iizuki‭

kubernetes helm
77%
+5 −0
How does the strict aliasing rule enable or prevent compiler optimizations?

Inspired by https://meta.stackoverflow.com/questions/432242, and the relevant main-space questions. I have heard that C and C++ something called the "strict aliasing rule", which means for exa...

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

c c++ undefined-behavior optimization strict-aliasing
66%
+2 −0
How do I get a hexadecimal string representation of a GdkRGBA struct in C?

I have a program that reads a hexadecimal string representation from a configuration file, turns it into a GdkRGBA struct from Gdk, uses gtk_color_dialog_button_set_rgba () to set it as the default...

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

c
71%
+3 −0
Why is spacy word vectors showing unexpected similar words?

Why is spacy word vectors showing unexpected similar words? Here is the code I am using: import spacy import numpy as np nlp=spacy.load('en_core_web_md') with open ('data/us.txt') as f: ...

0 answers  ·  posted 4mo ago by Asia‭  ·  edited 3mo ago by celtschk‭

python-3 spacy word-vectors
66%
+2 −0
Unable to configure enhanced route discovery in Apache Camel

I'm currently working with Apache Camel in a Quarkus application. I would like to configure the application to not discover any routes by default, and only include those defined in specific package...

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

java quarkus apache-camel enterprise-integration-patterns
70%
+5 −1
Is it a bad idea to block proxies/vpns for interacting with my app?

I run a small website and Im considering blocking proxies and vpns with ipquery to cut back on spam. I keep having bots autofill the contact us even though im using recaptcha. Does anyone have any ...

2 answers  ·  posted 4mo ago by jefforce‭  ·  last activity 4mo ago by matthewsnyder‭

proxy vpn
77%
+5 −0
How to keep git blame ignored commits up to date?

When I make a separate commit for code cleanup / style changes, I can suppress that commit from git blame so that I can follow a file's history easily without getting distracted by pure style chang...

1 answer  ·  posted 5mo ago by HeavyRain‭  ·  last activity 4mo ago by Alexei‭

git
60%
+1 −0
Tackling net::ERR_NAME_NOT_RESOLVED and timeout error on browser object creation when using Puppeteer

Used to work with PhantomJS. Want to upgrade to Puppeteer. Started with some code: "use strict"; const puppeteer = require("puppeteer"); const capture = async () => { let browser; try {...

1 answer  ·  posted 3y ago by sbirl‭  ·  last activity 4mo ago by Alexei‭

node.js puppeteer timeout
72%
+6 −1
Why is atoi dangerous and what should be used instead?

According to Which functions in the C standard library must always be avoided?, the atoi family of functions is dangerous and should never be used for any purpose. The rationale given in the answer...

1 answer  ·  posted 4mo ago by Lundin‭  ·  last activity 4mo ago by Alexei‭

c atoi strtol
77%
+5 −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...

2 answers  ·  posted 8mo ago by Andreas demands justice for humanity‭  ·  last activity 4mo ago by LAFK‭

java security encapsulation
60%
+1 −0
how to save the line number of a double-clicked line in tmux

In tmux I have the following command in my .tmux.conf, which will save a double-clicked line to the file /tmp/tmux_line.txt: bind-key -n DoubleClick1Pane select-pane \; copy-mode -M \; send-keys -...

0 answers  ·  posted 4mo ago by Trevor‭

tmux
75%
+4 −0
Understanding "logical OR" and "logical AND" in programming languages

Many programming languages either have keywords like or and and used for logic, or equivalent operators such as || or && - which are referred to as "logical or" and "logical and" respective...

3 answers  ·  posted 5mo ago by Karl Knechtel‭  ·  edited 5mo ago by Andreas demands justice for humanity‭

language-agnostic language-design logic
84%
+14 −1
What is the difference between operator precedence and order of evaluation?

When doing something simple such as this int a=1; int b=2; int c=3; printf("%d\n", a + b * c); then I was told that operator precedence guarantees that the code is equivalent to a + (b * c)...

2 answers  ·  posted 4y ago by Lundin‭  ·  last activity 5mo ago by Alexis Wilke‭

c operator-precedence order-of-evaluation unspecified-behavior
75%
+4 −0
Regex to get text outside brackets

I am trying to capture the content outside square brackets in groups, using this regex: (.*)\[.*?\](.*) And it works perfectly for a simple string like this: testing_[_is_]_done This is the...

2 answers  ·  posted 10mo ago by TonyMontana‭  ·  last activity 5mo ago by hkotsubo‭

regex python-3
66%
+2 −0
typeof_unqual behaves differently in gcc and clang

C23 6.7.3.6 contains this (informative) example demonstrating the use of typeof_unqual: const char* const animals[] = { "aardvark", "bluejay", "catte", }; typeof_unqual(animals) anima...

1 answer  ·  posted 5mo ago by Lundin‭  ·  edited 5mo ago by hkotsubo‭

c gcc clang c23 typeof
66%
+2 −0
Unable to log in with Flask-WTF and Flask-Login

I'm building a Flask application with user login functionality using Flask-WTF for form handling and Flask-Login for user authentication. However, I am unable to log in successfully. The page does ...

0 answers  ·  posted 5mo ago by misbahskuy‭  ·  edited 5mo ago by Andreas demands justice for humanity‭

python flask
42%
+1 −2
How to invoke dialog modal from module instead of directly using the showModal() method

I need to have 2 different models to create projects and to-do lists. I've figured out, that for HTML there is only one dialog menu that can be invoked with window.dialog.showModal(); directly. So ...

0 answers  ·  posted 6mo ago by Sevenfold‭  ·  edited 5mo ago by Andreas demands justice for humanity‭

javascript
60%
+1 −0
Ignore directory changes

I have a generated file that I want Tilt to ignore for re-building. However, when that file changes, Tilt also detects that the parent directory has changed based on its contents changing. I can fi...

0 answers  ·  posted 5mo ago by rcmosher‭  ·  edited 5mo ago by Andreas demands justice for humanity‭

tilt
50%
+0 −0
What can cause an HTML form submission result in a new pop-up window?

These are the methods I know of: Set the form's target attribute to _blank. Add submit event listeners (e.g., this SO thread). In the proprietary web app that I have to work with, every form...

0 answers  ·  posted 5mo ago by toraritte‭  ·  edited 5mo ago by toraritte‭

javascript html
50%
+1 −1
How can I properly implement Hexagonal Architecture and Domain Driven Design in the same application?

I'm trying to use the "hexagonal architecture" and "domain-driven design" paradigms together, in a Java application using Spring. I understand that my application should have a structure with 3 la...

1 answer  ·  posted 6mo ago by rudahee‭  ·  edited 5mo ago by Karl Knechtel‭

java spring hexagonal-architecture domain-driven-design
85%
+10 −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 6mo ago by user253751‭  ·  last activity 5mo ago by alx‭

c++ null null-pointer language-design c++11
60%
+1 −0
Best Practices for Precalculating Expensive Variables in Functions

A class might calculate static variables during instantiation, which are then used by various functions. A common technique to optimize function performance is to precalculate expensive variables u...

2 answers  ·  posted 5mo ago by wagimek‭  ·  last activity 5mo ago by wagimek‭

c++11
60%
+1 −0
empty line in table cell in reStructuredText (rst)

I would like to have an empty line in the cell of a table in reStructuredText. Consider the following example: .. list-table:: :header-rows: 1 * - aaa - bbb * - ccc - ddd ...

0 answers  ·  posted 5mo ago by Trevor‭  ·  edited 5mo ago by Trevor‭

reStructuredText
66%
+2 −0
Simultaneous comparison in Python

I want to make multiple comparisons at once, of the same type, in a Python program. For example, to check whether all of a certain group of strings are in a longer test string; or whether a specifi...

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

python operators logic
71%
+3 −0
Understanding "de Morgan's laws"

While trying to understand logical 'or'/'and', I encountered another problem (I'm writing Python code here, but my question is about the logic, not about any given programming language). I have som...

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

language-agnostic logic
81%
+7 −0
Common string handling pitfalls in C programming

This is a self-answered Q&A meant as a C string handling FAQ. It will ask several questions at once which isn't ideal, but they are all closely related and I'd rather not fragment the post in...

2 answers  ·  posted 3y ago by Lundin‭  ·  last activity 5mo ago by Karl Knechtel‭

c string string-literals string.h
50%
+1 −1
How to Suppress System Sound for Keyboard Shortcuts in C++ Desktop Application [closed]

In my desktop application developed in C++, I am encountering an issue where pressing the Ctrl + X, Ctrl + Shift + X, and Ctrl + D shortcut keys triggers a system sound. I would like to suppress o...

0 answers  ·  posted 5mo ago by Junior_Dev‭  ·  edited 5mo ago by Alexei‭

c++ windows winapi
60%
+1 −0
Generating combinations of elements, which are themselves sequences of the same length, where the elements have no value in common at any position

This question is adapted from a question I just helped fix up on Stack Overflow. I'm giving a different motivating example which I think will make it clearer what the requirements are and why a n...

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

python algorithms combinatorics
71%
+3 −0
Do Where and OfType preserve List capacity?

Unless I am mistaken, myList.Select(a => a).ToList() initializes the resulting list to the capacity of myList.Count. Does myList.Where(a => true).ToList() do so or does it build up from the i...

1 answer  ·  posted 6mo ago by LyndonGingerich‭  ·  last activity 5mo ago by rcmosher‭

c# linq iterable list
66%
+2 −0
Can UWPNuGetPackages be moved to another drive?

I'm trying to make a UWP app in Visual studio, but the NuGet package files have been huge. They just don't fit on my SSD, but I do have an HDD I could theoretically use. After a bunch of tinkering...

1 answer  ·  posted 2y ago by Ullallulloo‭  ·  last activity 5mo ago by Alexei‭

visual-studio nuget
66%
+2 −0
Why are model_q4.onnx and model_q4f16.onnx not 4 times smaller than model.onnx?

I see on https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct/tree/main/onnx: File Name Size model.onnx 654 MB model_fp16.onnx 327 MB model_q4.onnx 200 MB m...

1 answer  ·  posted 5mo ago by Franck Dernoncourt‭  ·  last activity 5mo ago by Derek Elkins‭

machine-learning onnx quantization language-model
91%
+20 −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 1y ago by Lundin‭  ·  edited 5mo ago by Lundin‭

c c23
50%
+0 −0
Cannot read properties of undefined (reading 'map') error in MERN stack project

In my project, I try to fetch data from the backend to display in the frontend using fetch API. Each time I do this I get Cannot read properties of undefined (reading 'map') error. When I check the...

0 answers  ·  posted 6mo ago by emmaluga‭  ·  edited 6mo ago by Alexei‭

reactjs react-hooks
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 6mo ago by Richard‭  ·  last activity 6mo ago by Alexei‭

python visual-studio installation terminal spacy
60%
+4 −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 7mo ago by alx‭  ·  last activity 6mo ago by Alexei‭

c malloc
75%
+4 −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 7mo ago by Iizuki‭  ·  last activity 6mo ago by Alexei‭

syntax graphql
80%
+6 −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...

1 answer  ·  posted 7mo ago by LyndonGingerich‭  ·  last activity 6mo ago by Michael‭

c# attribute
71%
+3 −0
Recursive traversal of composite tree of mutable "trait objects"?

I'm working on a background service/daemon for an embedded device, in Rust. The daemon manages several hardware components and these are structured using the Composite design pattern. The composite...

2 answers  ·  posted 10mo ago by ghost-in-the-zsh‭  ·  last activity 6mo ago by ghost-in-the-zsh‭

rust
66%
+2 −0
LocalDate format in fields stored as json via Hibernate

Setup I have a database table with field of JSONB type. I access said database using Hibernate. In hibernate I have entity mapped on said table. Entity contains field marked with @JdbcTypeCode(...

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

java json spring hibernate
71%
+3 −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, ...

2 answers  ·  posted 8mo ago by GeraldS‭  ·  last activity 6mo ago by jmb‭

rust drag-and-drop gtk4-rs
77%
+5 −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 6mo ago by Lundin‭  ·  last activity 6mo ago by Lundin‭

c polymorphism oop inheritance
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 7mo ago by Iizuki‭  ·  edited 6mo ago by Alexei‭

tools build haskell cabal haskell-stack
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 6mo ago by talex‭

maven scala
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 7mo ago by ShadowsRanger‭  ·  last activity 6mo ago by harmony‭

bash ffmpeg