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

40%
+2 −4
Problems with data structures and filestreams.

So I just started learning how to use file-streams in C & decided to attempt a question which is to do with library management in C, however I am currently encountering some problems and feel l...

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

83%
+8 −0
Which functions in the C standard library must always be avoided?

It would seem that the C standard library is a collection of diverse functions that pretty much just ended up in the standard by tradition or "accident", rather than through some careful plan or ra...

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

77%
+5 −0
How to deeply clone an array in Angular / TypeScript?

I have an array that I need to clone in Angular / Typescript. That is, any change done on an element from the cloned array should not affect the content of the initial array. How can I achieve thi...

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

66%
+2 −0
How to write database friendly code when using an ORM?

There are a lot of articles and presentations that show little love for ORMs. This is mainly because some queries are so complex and heavy on the database that they lead to significant issues in p...

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

33%
+0 −2
Deep linking from another app isn't working for Amazon prime and disney+hotstar

It's not possible to send data to amazon prime and disney+hotstar. I was trying to send user to amazon prime when they click a (video) link (e.g. https://www.amazon.com/gp/video/detail/B01MSPI8JN/r...

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

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‭

84%
+9 −0
Are there references in C?

When reading posts at programming sites such as this one, I frequently encounter people saying things like: "There is no pass-by-reference in C, everything is passed by value." People claiming su...

3 answers  ·  posted 2y ago by Lundin‭  ·  last activity 10mo ago by Alexei‭

75%
+4 −0
What are the types of DOM nodes?

If I am not mistaken any DOM "tree" node is actually a "branch", which would be an HTML element or perhaps a CSS pseudo-element, of course. If that's true what are the different node types and esp...

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

66%
+2 −0
What's the better way to store base64 in SQLite Database?

What's the better way to store base64 in SQLite Database? I was thinking to put base64 as TEXT since base64 has lots of chars. CREATE TABLE name (id INTEGER PRIMARY KEY AUTO_INCREMENT, image TEXT)...

1 answer  ·  posted 2y ago by Anonymous‭  ·  edited 2y ago by Anonymous‭

50%
+0 −0
How to get rid of HTML tags and convert entities in SQL Server?

I have to migrate a bunch of text from an old application into a new one. Some of these texts contain HTML tags and entities (HTML editor was used) and now they do not want to support this in the n...

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

37%
+1 −3
We app is terminated automatically at Windows server

I've my go app the is running a web API and working smoothly at my laptop. I read this and completed the IIS setup using a config file: <configuration> <system.webServer> ...

0 answers  ·  posted 1y ago by hyousef‭

60%
+1 −0
How can I export metrics from Angular frontend to be read with Prometheus ?

How can I monitor an Angular frontend with Prometheus? I was able to create metrics for my Node.js API using the express-prometheus module. But I can't find any Angular/Prometheus integration. Basi...

0 answers  ·  posted 2y ago by nelson777‭  ·  edited 2y ago by Peter Mortensen‭

82%
+12 −1
Why is it considered bad practice to use float for representing currency?

This is intended to be a canonical post for this problem which is pretty common. Especially among beginners. I've heard that I should avoid using floating point variables for representing curren...

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

33%
+1 −4
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 2y ago by deleted user  ·  last activity 2y ago by hkotsubo‭

80%
+6 −0
How kill a child process without read() hanging in the parent process?

There is an external program I'm calling from within my C/C++ program, by using fork() and execl(), and redirecting the stdio with dup2() to be able to read the output from the external program. I...

1 answer  ·  posted 2y ago by sktpin‭  ·  edited 2y ago by Lundin‭

22%
+0 −5
Ignore code paths

I try to ignore paths in the Codeql code scanning file. But every scan it seems that scanning doesn't ignore these files, do you have any tips?

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

75%
+4 −0
What's causing mypy to give an `[assignment]` error in this nested for loop?

I started adding types to my (working) solution to Exercism's "Kindergarten Garden" exercise, to learn how typing with python and Mypy (strict) works. While doing so, I ran into a Mypy error that I...

2 answers  ·  posted 1y ago by true_blue‭  ·  last activity 1y ago by Moshi‭

77%
+5 −0
bootstrap : how to align text with a button inside a grid

I have this bootstrap code (grid) <div class="container p-3 center"> <div class="row"> <div class="bg-light border-bottom border-secondary border-top col-6 te...

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

50%
+0 −0
How to uncollapse an entire link tree with JavaScript?

This data tree is comprised of clickable buttons and I want to expose all branches, in a single action, instead of clicking each vertical arrow button anew. I have tried the following code which d...

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

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

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‭

57%
+2 −1
width="100%" for an iframe, breaks responsiveness CSS directives

In a MediaWiki website I embed a PHP file containing a contact form via <iframe> with the following attribute pattern: width="100%" frameBorder="0" My problem I need the iframe to stre...

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by deleted user

75%
+4 −0
How would I fix my IntelliJ IDE? It cannot open and re-installing does not work.

So I was looking around for some async solutions and I found one on github, https://github.com/electronicarts/ea-async I follow the setup instructions for maven. Only to realize it didn't work (I ...

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

77%
+5 −0
How to dynamically change panel of ItemsControl?

Let's say I have some collection of data. My goal is to provide different kind of view of ItemsControl depending on user`s preference. For simplicity, we can assume that user can select only betwe...

1 answer  ·  posted 2y ago by FoggyFinder‭  ·  edited 2y ago by FoggyFinder‭

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‭

66%
+2 −0
What are the drawbacks of using data snapshot testing?

Our team is finally focusing on writing more automatic testing and one of my ex-colleagues recommended to try out the Verify library. The tool does the following: runs the test and compares the...

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

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‭

37%
+1 −3
Mocking methods with arguments

Let's say I have this class I want to mock class A { public void add(T arg) { B b = A.getB(); U val = somefunc(arg); V ret = b.add(val); } } I have a spy o...

3 answers  ·  posted 2y ago by klutt‭  ·  last activity 2y ago by klutt‭

71%
+3 −0
document.open() and the DOM tree of the loaded (closed) browser window on which it works

If I execute in browser console: document.write("Hello"); A new DOM document with the text Hello appears in the same browser window. From MDN documentation: Note: Because document.write() w...

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

70%
+5 −1
What does a variable followed by parentheses ("ptr()") mean?

What does ptr() mean in this code? #include<stdio.h> #include<stdlib.h> void PrintHello() { printf("Hello\n"); } int Add(int a, int b) { return a+b; } int main...

2 answers  ·  posted 2y ago by dumplings‭  ·  last activity 2y ago by Martin Bonner‭

37%
+1 −3
How can I delete a book from the collection by a particular title from my library file?

I would like to delete a book from the collection by a particular title from my library if the user enters 2 as input for my switch statement. How can I do that with my current code? #include<...

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

62%
+3 −1
Python looping 300 000 rows

Based on my last question comes new one. How to loop over 300 000 rows and edit each row string one by one? I have a list of 11-digit numbers stored in one single column in Excel, and I need to s...

1 answer  ·  posted 2y ago by sfrow‭  ·  last activity 2y ago by NoahTheDuke‭

60%
+1 −0
Find image for contact list in Android Java

How to get image of contact list? I was using cursor to get contact list. Here how it looks like. ArrayList<HashMap<String, String>> contactList = new ArrayList<>(); Has...

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

57%
+2 −1
What's the minimum API level for activity transition?

I was trying to show transition on activity changes. I had followed two method from SO. I lost those link so I can't add them here. My first method was I had used overridePendingTransition on onCr...

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

66%
+2 −0
How can I upload images or files to strapi using graphQl

How can I upload images or files to strapi using graphQl. I'm using Cloudinary as the image provider. The strapi admin panel works fine, uploads the images to cloudinary. But, when using graphQl m...

0 answers  ·  posted 1y ago by Phtremor‭

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‭

33%
+1 −4
How can I modify the code above to accept string as user input and use strcmp to compare with the contents of the text file & then delete that line?

I want to enter a string to compare with the text file, and if that word matches, then I want to delete that line containing that string. How can I modify the code below, since the code below take...

1 answer  ·  posted 2y ago by dumplings‭  ·  edited 2y ago by Alexei‭

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‭

28%
+0 −3
How to make this treewalker code having a regular for loop or a forEach() method?

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

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

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__‭

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‭

80%
+6 −0
Are there any downsides related to using Maybe or Optional monads instead of nulls?

I have recently stumbled across the Maybe (or Optional) modal usage in .NET Code: example code or this one example article Based on everything I read, there are multiple advantages on relyi...

2 answers  ·  posted 2y ago by Alexei‭  ·  last activity 2y ago by Derek Elkins‭

60%
+1 −0
Preloading some data at application startup as fast as possible

I am caching some very static information (changes once per day) in my ASP.NET Core application. This is normally done when needed ("lazy"). One such cache item is a 50K list of items that are tak...

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

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‭

80%
+6 −0
Continuously read from piped input using Vim

In Vim, it's possible to tell it to read from stdin instead of a file, by using vim -. This is so that you can pipe the output of one command into Vim, to view/edit it there. The problem I'm facin...

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

80%
+6 −0
TypeScript is unable to infer the correct type for a mapped tuple

I was playing around with mapped tuples and came across an interesting case where TypeScript cannot infer the types used: interface Foo<A, B> { (a: A, b: B): any } function test<...

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

57%
+2 −1
Function.prototype.call()

I wanted to print to browser console the number of li list items of a given ul list. This didn't work (console output was undefined): console.log(document.querySelectorAll(".example").length); ...

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

50%
+0 −0
What should I use instead of managedQuery?

managedQuery is recently deprecated. ManagedQuery was used for using Cursor. What should I use since managedQuery was deprecated? Without it, I can't work with Cursor. So there must be alternative ...

1 answer  ·  posted 2y ago by Anonymous‭  ·  edited 2y ago by Alexei‭