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)
42%
+1 −2
What might happen if I ignore warning?

#include <iostream> using namespace std; int linearSearch(int array[], int n, int key){ for(int i=0;i<=n;i++){ if(array[i]==key){ return i; } } } int main() { int ...

2 answers  ·  posted 2y ago by Anonymous‭  ·  last activity 2y ago by Lundin‭

81%
+7 −0
Is it a good idea to have a permanent branch for a feature?

I'm rather new to using git, so I'm not sure about the best practices regarding it. I have a feature branch branched off, and periodically when the feature needs to be updated I will add some commi...

3 answers  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by Hyperlynx‭

71%
+3 −0
setting of translateX for carousel image slider

I made carousel image slider by following tutorials. To slide images , I made the below function. const moveToSlide = (track, currentSlide, targetSlide) => { track.style.transform = 'translat...

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

42%
+1 −2
How do I filter an array in C?

No, I'm not trying to get the full program written completely in C by you guys. I only need some way to implement the functionalities of each function I found confusing. In this challenge in Code ...

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

60%
+1 −0
Uncaught ReferenceError: variable is not defined

I have a variable defined using const keyword. function Text() { const variable = "Hello!"; } console.log(variable); When I try to access this variable, I get: Uncaught ReferenceError...

1 answer  ·  posted 2y ago by Kevin M. Mansour‭  ·  edited 2y ago by Alexei‭

81%
+7 −0
How do I ask git-show-branch to display a commit range?

For some tasks, I find git show-branch easier to follow than git log. For example, inspecting the history on someone's PR before merging it. git show-branch master topic stops at the first common ...

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

80%
+6 −0
How to parse a date with more than 3 decimal digits in the fractions of second?

I'm using SimpleDateFormat to parse a string containing a date/time, but the result has a different date, hour, minute, second and millisecond: SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM...

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

57%
+2 −1
How to include HTML files in another HTML file with vanilla Javascript?

I develop an HTML-CSS-JavaScript-PHP contact form and I have a large HTML file which is very long and very wide (lots of horizontal scrolling due to nesting) and it's hard for me personally to work...

0 answers  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

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%
+1 −1
Nannou model requires a function pointer: How to return a function pointer

Trying to make a nannou app from the template but with a customizable model() function. The template has this main(): fn main() { nannou::app(model).update(update).run(); } The model t...

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

83%
+8 −0
How to declare variable-length arrays correctly?

This is meant as a FAQ Q&A regarding variable-length arrays (VLA). The two bugs described below are surprisingly common. I'm trying to use the variable-length arrays feature of C99 (and newe...

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

66%
+2 −0
Unable to use pyttx3 (libespeak.so.1: cannot open shared object file: No such file or directory)

from tkinter import * from tkinter import messagebox, filedialog import pyttsx3 import PyPDF2 import os import webbrowser root = Tk() # root.geometry("500x500") root.title("Audio Book") ...

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

71%
+3 −0
How do I redact values when Save()ing a yaml structure with YamlDotNet?

I handle several projects that use yaml files for configuration, and load them with YamlDotNet. It is sometimes useful to log the effective configuration when the program starts, to aid future debu...

0 answers  ·  posted 2y ago by ajv‭  ·  edited 2y ago by Troy‭

40%
+0 −1
Migrating a MediaWiki website to Drupal

I consider to migrate a large MediaWiki website to Drupal 9. All the webpages include MediaWiki syntax, just one example is the link syntax: [[ARTICLE NAME|LINK_TEXT]] for internal links [URL ...

0 answers  ·  posted 2y ago by deleted user

37%
+1 −3
theme always not changing [closed]

const body = document.body; const light = evt => { body.setAttribute('data-theme', 'light'); localStorage.setItem("theme", "light"); console.log("light"); } const dark = ...

0 answers  ·  posted 3y ago by Anonymous‭  ·  closed 3y ago by Alexei‭

83%
+8 −0
Why does Firefox block based on a restrictive default-src directive, when more specific, more permissive *-src exist?

I am working on a website which unfortunately uses a mix of linked and inline CSS and Javascript (and, even more unfortunately, I can't do a lot about the use of inline CSS and Javascript), and am ...

1 answer  ·  posted 3y ago by Canina‭  ·  last activity 3y ago by Moshi‭

66%
+4 −1
How to get string length in D?

I'm new to D and am planning to use it for golfing. I want to make a ROT13 converter and I want to determine the length of an inputted string. Is there a function for this? If not, what ways can I...

3 answers  ·  posted 3y ago by General Sebast1an‭  ·  last activity 2y ago by hkotsubo‭

25%
+0 −4
Why storing variables inside a variable?

In the past I have read about the fact that some programmers use a variable to hold two or more variables (instead holding a mere value or an array). There might also be cases when programmers use...

1 answer  ·  posted 3y ago by deleted user  ·  edited 3y ago by Derek Elkins‭

77%
+5 −0
What's the difference between =, == and === operators in JavaScript?

While learning JavaScript, I started to see =, == and === operators. What's the difference between them?

3 answers  ·  posted 3y ago by Kevin M. Mansour‭  ·  last activity 3y ago by hkotsubo‭

81%
+7 −0
What's the difference between placing <script> in the <head> and placing in the <body>?

While learning JavaScript, I started to see sometimes the <script> is placed in the <head> and sometimes it is placed in the <body>, What's difference between placing the <scri...

1 answer  ·  posted 3y ago by Kevin M. Mansour‭  ·  last activity 3y ago by Kevin M. Mansour‭

53%
+5 −4
What's the difference between Inheritance and Polymorphism?

I'm using Java code as an example, but this can be answered if you don't know Java. class Bird{ public void sing(){ System.out.println("Testing"); } } class anClass ex...

2 answers  ·  posted 3y ago by deleted user  ·  edited 2y ago by Alexei‭

22%
+0 −5
Are the terms "property" and "method" practical in programming languages other than JavaScript? [closed]

I would say that the terms "property" and "method" are basic in JavaScript programming (at least in the context of web/front), but are they basic or common in other programming languages such as C,...

0 answers  ·  posted 3y ago by deleted user  ·  closed 3y ago by Alexei‭

84%
+14 −1
What's the correct way to merge a branch and its dependent branch back to master?

In git I branched feature-A from master. To reduce eventual merge conflicts later, I branched feature-B, which heavily overlaps and depends on A, from feature-A. A build of the feature-B branch s...

2 answers  ·  posted 3y ago by Monica Cellio‭  ·  edited 2y ago by hkotsubo‭

50%
+0 −0
A standard about content types when creating a web shop with Drupal

I would assume the following content types would be standard when creating a web shop with Drupal but maybe I am wrong: Home page Article page Product page Service page Another page Are t...

0 answers  ·  posted 3y ago by deleted user

66%
+4 −1
Is it possible to mutate the DOM directly from HTML, without any JavaScript?

All the ways I know of to mutate a DOM are JavaScript. Just for broadening general knowledge I want to know if there is any common way to mutate the DOM via HTML itself, without involving any Java...

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

80%
+6 −0
error[E0507]: cannot move out of X which is behind a shared reference.

Making a Nannou App that draws a line to the screen. My model only contains the window itself and a vector of tuples describing the points and color. Similar to this example(under Drawing Lines) ...

1 answer  ·  posted 3y ago by telefza‭  ·  last activity 3y ago by telefza‭

75%
+4 −0
How do I communicate with a subproject in qmake?

When working with a qmake subdirs project you may want to share configuration between multiple projects. In a less common case you may including a external project within your own as code and want ...

1 answer  ·  posted 3y ago by dmckee‭  ·  last activity 3y ago by dmckee‭

77%
+5 −0
updating a function within a struct

What I want: An object that contains a function that I can update after creation. I created a struct that contains a parameter b and a function(closure?) named Internal_Fn. struct MyThing { ...

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

37%
+1 −3
Are there textual-formats for documenting actions in Graphical Windows systems? [closed]

I've recently been involved with creating text documentation of steps for workflows in graphical windows systems (and web-pages). These are often somewhat wordy, for example: "Click on the 'Exit' ...

0 answers  ·  posted 3y ago by CodeFarmer‭  ·  closed 2y ago by Alexei‭

37%
+1 −3
Why does this code that uses a pointer-to-pointer-to-int segfault?

Hello folks, can someone resolve this seg fault with me please, i can't find the error where it occur. Thank you. #include <stdlib.h> #include <stdio.h> int ft_ultimate_range(int *...

1 answer  ·  posted 3y ago by M3dc0d‭  ·  last activity 3y ago by Lundin‭

80%
+6 −0
Strange change of object lightness and colour in Nannou application

Building a Nannou App from their template. I want a circle to slowly fade in color and randomly change color when hitting the boundary of the window. But there is something strange going on when ...

1 answer  ·  posted 3y ago by telefza‭  ·  last activity 3y ago by telefza‭

33%
+1 −4
How to call a function from ruby-on-rails (HTML)?

Let I have a button <button type="button" onclick = "myfunction()" class="collapsible">Expand content</button> And, I have a JS function. function collapse() { var coll = docu...

1 answer  ·  posted 3y ago by deleted user  ·  last activity 3y ago by Kevin M. Mansour‭

28%
+0 −3
Storing input from different frontend webpages of a multi page contact form

I consider to create a multi page contact form in which there is one backend page but about 5 front-end pages (stage 1-5). Pages 1-4 are input pages and page 5 is for a submit button and a success ...

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

87%
+12 −0
What compiler options are recommended for beginners learning C?

When reading questions about C programming from beginners, I very often see them describing peculiar run-time errors and crashes, segmentation faults and similar. They have spent a lot of time chas...

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

35%
+4 −9
Find the name of the student with the top mark, display their name and mark

I have a CSV file like this: name,surname,score Moon,Walko,148 Jerald,Gryder,150 I need to find the highest score. My attempt: namespace test { class Program { string[...

2 answers  ·  posted 3y ago by InPut‭  ·  last activity 6mo ago by NetMage‭

84%
+9 −0
What is a good modern language to use for a Business Rules project?

This is a rather vague question, but I'm trying to solve a specific problem and I'm inexperienced in most of the potential solutions, so please forgive the inherent ambiguity. I have access to a d...

3 answers  ·  posted 3y ago by Sigma‭  ·  last activity 11mo ago by matthewsnyder‭

50%
+2 −2
Splitting a large HTML file into two or more HTML files without JavaScript

I am developing a modular HTML-PHP-CSS no-JavaScript (JavaScriptless) contact form and the HTML is becoming increasingly large, around 80 lines (and could easily grow to be significantly larger as ...

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

22%
+0 −5
What are the types of contact forms?

I get the impression that there are two general types of contact forms: A regular contact form where all fields are in one webpage ; such form might be very long for a potential customer ("too m...

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

42%
+1 −2
redirect to "main" code in Ruby using Ctrl

In Android Studio, when I click on a variable. It redirects me to where the variable was declared. Even, when coder writes lot of code than, it becomes hard to find "main" object by scrolling. Rub...

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

71%
+3 −0
Why use an asterisk after a type?

#include<stdio.h> struct Node{ int data; struct Node* next; }; Here I used an asterisk after Node. What is it used for? What if I don't put any asterisk after Node (both Node...

2 answers  ·  posted 3y ago by deleted user  ·  edited 3y ago by hkotsubo‭

40%
+2 −4
constructor in C

#include<stdio.h> struct Book { char title[20]; char author[20]; int pages; }; void init_Book_types(struct Book* aTitle,struct Book* aAuthor,struct Book* aPages){ aTitle->ti...

2 answers  ·  posted 3y ago by deleted user  ·  last activity 10mo ago by __blackjack__‭

60%
+1 −0
Saving modified data in gridview on clicking SaveButton

I am struggling to do a save button in C# Windows Form Application where I have a GridView and I want to save all modifications I do in GridView Table(I connected it to SQL). This is the data sourc...

1 answer  ·  posted 3y ago by Cri‭  ·  edited 3y ago by Alexei‭

50%
+1 −1
Input taking only first character of a string

I wrote a program named Kernel.c 2 months into my life in programming and created 4 functions at the time, and now there are 7 functions. Recently, I updated the program completely onto an online ...

1 answer  ·  posted 3y ago by General Sebast1an‭  ·  last activity 3y ago by elgonzo‭

50%
+2 −2
Print value from constructor

#include<iostream> using namespace std; class Book{ public: string title; string author; int pages; Book(string aTitle, string aAuthor, int aPages){ aTitle = title; ...

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

50%
+2 −2
Accessibility standard/s for multilined <input type="text"> fields

I have a simple HTML contact form and I wish to create a text area in it with <input type="text"> but without a <textarea> tag. The end product should be an <input type="text"> f...

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

66%
+2 −0
Mixing "operational" database models with archiving ones in the database context

Context Our product owner has realized that some entities are duplicated from time to time and that a merge is required. This should clean up existing duplicates and also allow special users to me...

1 answer  ·  posted 3y ago by Alexei‭  ·  last activity 3y ago by meriton‭

70%
+5 −1
Where did my proper divisor sum program went wrong?

Here in Python, I created a program for this challenge and I'm having trouble debugging it. I already fixed most errors I have on my program but here's what I have left: x=y=z=[];i=0.0;a=int(input...

1 answer  ·  posted 3y ago by General Sebast1an‭  ·  last activity 3y ago by hkotsubo‭

40%
+2 −4
unable to create databases in Ruby

I had installed Ruby. rvm install 2.6.6 I had Ruby which version was 3.0.0. I had removed it. Then, installed 2.6.6. When I try bundle install I got no error. When I tried following command...

0 answers  ·  posted 3y ago by deleted user  ·  edited 2y ago by Alexei‭

71%
+3 −0
How to create a MySQL generated column that uses a join in a concat?

I have a column that is a concatenation of 5 other columns plus a join to a different table. UPDATE db.a JOIN db.b ON fk_b = b.pk SET concat_field = CONCAT(field1,field2,field3,b.field,field4,fi...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by Alexei‭

77%
+5 −0
Validate All Object Properties with JSON Schema

I'm writing a JSON schema to validate asset files for a program. The JSON I need to parse is structured so: { "jobs": { "software-developer": { "job-description": "sw-dev.md:0", "pay": 800...

1 answer  ·  posted 3y ago by Josh Hyatt‭  ·  last activity 3y ago by elgonzo‭