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)
60%
+1 −0
How to refer to the same class twice from one Entity Framework entity?

I have two classes, Contestant and Picture, with the following setup: public class Contestant { ... public int AvatarID { get; set; } [ForeignKey(nameof(AvatarID))] public ...

1 answer  ·  posted 1y ago by FrankLuke‭  ·  edited 1y ago by Alexei‭

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‭

66%
+2 −0
How do I (compactly) initialize a 2-d array of structs with the same value?

I learned about the ** operator for array-repeat, and I love it. I have a struct that contains a 2-d array of inner structs, like const D1 = 30; const D2 = 40; const Inner = struct { .a: u32, ....

0 answers  ·  posted 1y ago by aghast‭

77%
+5 −0
Any testimonials for any C++ units of measure library?

The question is about libraries that extend the data type system to ensure physically realistic computations. Think std::chrono but for distance and mass and other things as well as for time. Inste...

1 answer  ·  posted 1y ago by Fred Wamsley‭  ·  last activity 1y ago by Ben‭

77%
+5 −0
Child div doesn't inherit parent's div background-color

I have a parent div with two child divs. I want the parent div and the child divs to have a blue background color when it's hovered. But the child divs doesn't inherit the background color. It is o...

1 answer  ·  posted 1y ago by Bennshinpoes‭  ·  last activity 1y ago by r~~‭

42%
+1 −2
How to generate random objects at different locations on x, y, z axis

I have been trying to generate a random object on all three axis in different locations. However, Vector3 doesn't accept that many overloads e.g: Vector3 spawnPos = new Vector3(Random.Range(spawnL...

1 answer  ·  posted 1y ago by simonJN‭  ·  last activity 1y ago by deleted user

70%
+5 −1
C naming convention, module trigrams?

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

3 answers  ·  posted 1y ago by AdriZ‭  ·  last activity 1y ago by Dirk Herrmann‭

40%
+0 −1
white screen issues but not in USB tethering mode

I am getting a white screen issue for my angular portal, only if I am not using "USB tethering". When I use home/office wifi, and mobile hotspot, I get a white screen when I use USB tethering fro...

0 answers  ·  posted 1y ago by SmartestVEGA‭  ·  edited 1y ago by Ethan‭

60%
+1 −0
org.apache.http.NoHttpResponseException: nginx.apps.cloud.cloud.local:443 failed to respond

Getting the following error only when I call a post API through Nginx [0m[31m12:48:35,903 ERROR [io.acurio.hub.api.rest.impl.DesignsResource] (default task-16) Failed to invoke workflow: com.masha...

0 answers  ·  posted 1y ago by SmartestVEGA‭

71%
+3 −0
Cast uninitialized variable to (void)

Is it undefined behaviour to cast an uninitialized variable to (void)? Example: int main() { int x; (void)x; return 0; }

4 answers  ·  posted 1y ago by Estela‭  ·  last activity 1y ago by Ethan‭

57%
+2 −1
ffmpeg: apply a filter from a start time to the end of the video

I'm using ffmpeg to apply a filter in between two time points. I am using the between() operator to specify the times. For example, to apply the yadif filter between 30 and 90 seconds I run: ffmpe...

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

44%
+2 −3
When I use the piecewise function I get more columns in the output

I have this code syms t y(t) = t*heaviside(t)*heaviside(1-t); x(t) = piecewise(0<=t<=1,1,t<0,0,t>1,0); l = -2:0.01:2; disp(y(l)); disp(x(l)); and in the output, I ge...

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

66%
+2 −0
Input date in Angular Material date picker in dd/MM/yyyyy format

I am trying to create an application that takes a date as user input which is then passed as a parameter to an API call. The local date format is dd/MM/yyyy. I want the user to be able to enter t...

1 answer  ·  posted 1y ago by mcalex‭  ·  last activity 1y ago by tmpod‭

81%
+7 −0
Is there any benefit to using new?

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

1 answer  ·  posted 1y ago by Moshi‭  ·  last activity 1y ago by deleted user

57%
+2 −1
What should I read if I knew C++ twenty years ago? [closed]

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

0 answers  ·  posted 1y ago by Fred Wamsley‭  ·  edited 1y ago by Alexei‭

c++
45%
+3 −4
Create a list of Niven numbers in Python

There's this new challenge on Code Golf CD and I'm using Python to do it. A little bit of golfing already took place, so the code might look a bit messy for you. Anyway, I'm proud of what I've writ...

2 answers  ·  posted 1y ago by General Sebast1an‭  ·  last activity 1y ago by Dirk Herrmann‭

71%
+3 −0
Why is boolean value f (false) defined as a parsing-word while t (true) is not in Factor?

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

1 answer  ·  posted 1y ago by Razetime‭  ·  edited 1y ago by Alexei‭

60%
+1 −0
How to get a default value from an assoc in Factor programming language

To get a value from an assoc and provide a default value if the value does not exist, I am using the following definition: :: at-def ( key assoc default -- value ) key assoc ?at [ drop default ] w...

1 answer  ·  posted 1y ago by Razetime‭  ·  last activity 1y ago by erg‭

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 1y ago by Ullallulloo‭  ·  last activity 1y ago by Ullallulloo‭

66%
+2 −0
How to create a quotation containing the given token in a syntax word in Factor programming language

I am trying to define a syntax word as follows: USING: kernel syntax parser fry prettyprint ; IN: syn-try SYNTAX: syn scan-word '[ _ ] . ; Given a word, I want to create a quotation conta...

2 answers  ·  posted 1y ago by Razetime‭  ·  edited 1y ago by Alexei‭

85%
+10 −0
How to manage user-specific application data on Linux?

I am developing an application that targets Linux-based OS, and I need to store the user's configuration, metadata and other things in a persistent way (i.e. on the file system). I know that one c...

3 answers  ·  posted 1y ago by Björn‭  ·  last activity 1y ago by celtschk‭

77%
+5 −0
Keep local branch changes to resolve all remaining conflicts in a merge

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

1 answer  ·  posted 1y ago by Quasímodo‭  ·  last activity 1y ago by Quasímodo‭

77%
+5 −0
What is the Python Global Interpreter Lock?

What exactly is the Python Global Interpreter Lock (GIL)? As someone who is relatively new to Python, is this something I need to be aware of, or is this just some implementation detail of the inte...

1 answer  ·  posted 1y ago by Moshi‭  ·  last activity 1y ago by Derek Elkins‭

66%
+2 −0
How to plot table from pandas dataframe

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

1 answer  ·  posted 2y ago by mcp‭  ·  last activity 1y ago by __blackjack__‭

71%
+3 −0
How to add vertical lines for visual separation in pandas plot

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() plt.show() Question Ho...

2 answers  ·  posted 2y ago by mcp‭  ·  last activity 2y ago by samcarter‭

81%
+7 −0
How to use grep to print only specific word from a string

I have a variable that contains a string: $CCSR = "branches/features/arm_and_musl" I want to get only the part after the last /. In this case it's "arm_and_musl" but it can be anything. So som...

3 answers  ·  posted 2y ago by Megan‭  ·  edited 2y ago by hkotsubo‭

75%
+4 −0
How to configure .gitignore to ignore all files except a certain directory

MWE In the terminal run: mkdir mwe cd mwe mkdir dir touch f1.txt f2.pdf dir/f1.txt dir/f2.pdf git init . Create a .gitignore with: * # ignore all !dir/ # except this directory ...

1 answer  ·  posted 2y ago by mcp‭  ·  last activity 2y ago by Moshi‭

71%
+3 −0
Do you need to use std::move to store a parameter passed by value?

If you have a class which needs to store a construction parameter internally, and you want to take advantage of move semantics, I understand that the parameter should be passed by value: class Foo...

1 answer  ·  posted 2y ago by deleted user  ·  last activity 2y ago by Dirk Herrmann‭

50%
+0 −0
Working with a generic class that uses a type that should be of generic type

I have followed Nick Chapsas' tutorial to avoid throwing a ValidationException to treat validation errors and instead rely on LanguageExt.Common.Result<> from LanguageExt library. I have ma...

0 answers  ·  posted 2y ago by Alexei‭

50%
+0 −0
How to migrate NLog configuration from XML file(s) to application settings (JSON)?

I have just created an ASP.NET Core 6 application and added NLog support for logging: NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger() However, this API is almost deprecated as ...

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

28%
+0 −3
Need help in migrating a Python2 custom middleware to current Python3 version

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

0 answers  ·  posted 2y ago by roronoa_zoroDR‭  ·  last activity 2y ago by Monica Cellio‭

71%
+3 −0
How to correctly daemonize a Rocket-based app?

Summary I'm refactoring a Rust-based service/daemon to move away from gRPC and use a Rocket-based API instead. I'm also using the daemonize crate to turn the foreground process into a background p...

1 answer  ·  posted 2y ago by ghost-in-the-zsh‭  ·  last activity 2y ago by ghost-in-the-zsh‭

60%
+1 −0
How to generate lots of hyperlinks rather fast using ClosedXML library?

I am using ClosedXML library to generate an Excel containing thousands of hyperlinks using cell's Hyperlink property: cell.SetValue(text).Hyperlink = new XLHyperlink(url); Such a call takes abo...

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

83%
+8 −0
What allows a string slice (&str) to outlive its scope?

As a relative newcomer to Rust, I'm trying to understand the behaviour of lifetimes, but I am confused by the following code: let s: &str = "first"; let mut r: &str = s; println!("First ...

2 answers  ·  posted 2y ago by deleted user  ·  last activity 2y ago by Moshi‭

60%
+1 −0
VBScript Listener in SSRS

Is it possible to add listeners via VBScript/ JS directly into a SRSS report? Goal: Track changes of input fields and key press inside the wrapper React based on the events Directly in the...

0 answers  ·  posted 2y ago by Yolanda‭  ·  edited 2y ago by Alexei‭

71%
+3 −0
Assert that some code is not present in the final binary, at compile or link time.

I'd like to assert that some code can be optimized out, and is not present in the final binary object. #define CONSTANT 0 #if (!CONSTANT) [[landmine_A]] #endif static int foo(void); void...

1 answer  ·  posted 2y ago by alx‭  ·  last activity 2y ago by alx‭

57%
+2 −1
How to pass in a readable file (stream) to a Zig function?

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

0 answers  ·  posted 2y ago by aghast‭

80%
+6 −0
array of arrays vs array of pointers to store array of string literals

Let's consider the following code: const char a[][4] = {"aa", "aaa"}; const char *b[] = {"bb", "bbb"}; const char *const c[] = {"cc", "ccc"}; For shared libraries, both b and c arrays require...

0 answers  ·  posted 2y ago by alx‭  ·  edited 2y ago by alx‭

71%
+3 −0
How to write a macro that discards the const qualifier, for any type?

How to write a macro that discards the const qualifier, for any type? I hope some combination of typeof and a cast will do, but haven't found the combination. I tried this, without luck: #define...

2 answers  ·  posted 2y ago by alx‭  ·  last activity 1y ago by alx‭

81%
+7 −0
PGP sign emails sent with git-send-email(1)

How can we use git-send-email(1) to sign patches (emails) with the gpg(1) keyring? I've heard it can be done, but couldn't find anything in the git-send-email(1) documentation nor in a web search.

3 answers  ·  posted 2y ago by alx‭  ·  last activity 3d ago by alx‭

85%
+10 −0
Vim: how to search for all instances of a string, except for those that are between two specific strings

Using Vim, I am trying to search for all instances of a specific string, except for those that fall somewhere in between two other specific strings. For example, I want to determine all instances ...

2 answers  ·  posted 2y ago by Trevor‭  ·  last activity 2y ago by Dirk Herrmann‭

66%
+2 −0
Order a subcollection from linq

I am using linq/EF core to retrieve data via an API call. How do I sort the collection of related data for each retrieved entity? Assume the following structure: an Order is made on a certain da...

1 answer  ·  posted 2y ago by mcalex‭  ·  last activity 2y ago by Alexei‭

85%
+10 −0
Is it possible to undo a git reset?

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

2 answers  ·  posted 2y ago by celtschk‭  ·  edited 2y ago by Alexei‭

66%
+2 −0
C# WPF datagrid not persisting inserts

I am working with VS 2022 and trying to make a WPF MVVM application. The application updates the items displayed in the datagrid, persisting the changes to the database upon save. However, adding a...

0 answers  ·  posted 2y ago by FrankLuke‭

42%
+1 −2
How to solve missing JAR files error from Ant

I keep getting this error: Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.SSHExec was not found. This looks like one of Ant's optional components. Action: Check that the ap...

1 answer  ·  posted 2y ago by Megan‭  ·  last activity 2y ago by Megan‭

60%
+1 −0
How to set update-crypto-policies to LEGACY in Dockerfile

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

2 answers  ·  posted 2y ago by Megan‭  ·  last activity 2y ago by Megan‭

77%
+5 −0
How to open a file and edit its content in groovy script

I have a Makefile in my Jenkins job's workspace, that I want to edit out certain parts from and then save it, before running next part of the script that uses this Makefile. The part that I want t...

2 answers  ·  posted 2y ago by Megan‭  ·  last activity 2y ago by Alexei‭

40%
+2 −4
Child process works only once after the parent's two calls to scanf

This program creates a child process and shares two integers (base and height) through the shared memory. The parent process asks four times to insert two integers and wait for the child process t...

1 answer  ·  posted 2y ago by Luca_Impellizzeri‭  ·  last activity 2y ago by Alexei‭

75%
+4 −0
Is it possible to write protocols for enumerations in Python?

Having recently learned about protocols in Python, I now wonder if you can write a protocol for enumerations. That is, a protocol that says that you are supposed to pass an enum that has certain it...

1 answer  ·  posted 2y ago by celtschk‭  ·  last activity 2y ago by r~~‭

60%
+4 −2
Watertight Mesh Representation

A watertight mesh is one which does not have holes, and for which each face has a designated inside and outside. Such a mesh can be "tetrahedralized", has a defined volume, and can be an operand in...

0 answers  ·  posted 2y ago by Josh Hyatt‭  ·  edited 2y ago by Josh Hyatt‭