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

28%
+0 −3
What is [{options}] in JavaScript?

I am trying to understand this code: const iframes = iFrameResize( [{options}], [css selector] || [iframe] ); The code can be found in this documentation. Is [{options}] an array of objects an...

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

62%
+3 −1
What is Backus–Naur form as applied in computer programming?

What is Backus–Naur form as applied in computer programming? From Wikipedia In computer science, Backus–Naur form (/ˌbækəs ˈnaʊər/) or Backus normal form (BNF) is a metasyntax notation for cont...

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

77%
+5 −0
Why can't a derived class add a const qualifier to a method?

Say we have an abstract class Foo declared as so: class Foo { public: virtual void test() = 0; }; Let's say that we make a derived concrete class FooDerived, and decide to mark it's ve...

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

77%
+5 −0
How should one match a specialized version of a variant?

Let's say I have a variant that can hold a bunch of different types of values (say I got them from parsing a JSON or similar). using Value = std::variant<std::monostate, int, double, std::strin...

1 answer  ·  posted 2y ago by Moshi‭  ·  last activity 11mo ago by Baum mit Augen‭

30%
+1 −5
Explaining the result of an arithmetic expression in JavaScript

I misunderstand why the following code outputs -1 in console. x = 42; x = (x == 42) * -1 + (x != 42) * x; -1 Due to Type Coercion, the comparison of x to 42 yields true and is thus transl...

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

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‭

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‭

50%
+1 −1
Recursion without a procedure ("function") in JavaScript

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  ·  edited 2y ago by Alexei‭

25%
+0 −4
Does a for...of loop must contain a variable without assignment sign, and why?

The following code pattern reflects this answer. This code contains a for...of loop: for (const child of e.childNodes) { // Do stuff; } Does a for...of loop must contain a variable without...

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

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‭

40%
+0 −1
Is there a JavaScript command to remove all CSS pseudo-elements whatsoever in a document? [closed]

In a dense DOM tree created by a content management system which I didn't create and don't know much about there might be pseudo elements hiding in various places. To ensure that, I want to run so...

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

70%
+5 −1
Delete all occurrences of a character in a webpage with vanilla JavaScript

Primarily for learning, I would like to try to delete a specific character (letter or number or special character), wherever it is in a webpage, with vanilla JavaScript. The webpage won't change a...

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

71%
+3 −0
Is `-isystem` a POSIX cc option?

Is -isystem/path/to/sys/includes a standard compiler option, or is it a compiler extension implemented by gcc, clang, and maybe other compilers? Can I rely on its availability? I couldn't find th...

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

60%
+1 −0
How to access the visual editor from JavaScript in MediaWiki?

In MediaWiki 1.36.1 with Skin:Timeless, the following JavaScript code doesn't work. I get in browser console: Your skin is incompatible with VisualEditor. See https://www.mediawiki.org/wiki/Exte...

0 answers  ·  posted 2y ago by deleted user  ·  edited 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‭

50%
+0 −0
MediaWiki JavaScript way to view the history of a page

I wish to view the revision-history-webpage of a webpage in MediaWiki without the conventional button to do so (I've disabled that button for aesthetic reasons). Please disable the MediaWiki View ...

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

25%
+0 −4
Unable to boot from manjaro usb key [closed]

Unable to boot from manjaro usb key it looks like it is due to secure boot how can I do it without disabling the secure boot

0 answers  ·  posted 2y ago by hedibensaid‭  ·  closed 2y ago by Alexei‭

25%
+0 −4
Unable to boot from popos usb key [closed]

Hi How can I boot from usb key containing popos system without disabling secure boot in bios ? thanks

0 answers  ·  posted 2y ago by hedibensaid‭  ·  closed 2y ago by Alexei‭

66%
+2 −0
Access denied to read SQS queue just created

I've been trying to get Amazon SQS working with the v3 JS client. I've gotten to the point where I can successfully create a queue using the frontend, but the issue starts when I try and send/recei...

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

50%
+1 −1
Why does a keydown event is listened only once?

The following code (credit for user:hkotsubo) moves the user to another page if Alt+Shift+E are pressed together. window.addEventListener('DOMContentLoaded', () => { let domain = window.loca...

0 answers  ·  posted 2y ago by deleted user

75%
+4 −0
What version of runtime environment does a .NET 5 application actually needs?

Our team deals with a legacy application that relies on a rather old deployment process and infrastructure: we deploy the application on an environment very similar to the production called Clon...

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

75%
+4 −0
Move to the edit webpage of a webpage via the keyboard with vanilla JavaScript

The webpage example.com has an edit webpage (from which one can edit example.com itself). example.com/index.php?title=עמוד_ראשי&action=edit I want that after I click ALT+Shift+E, I would im...

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

50%
+0 −0
Using single xml file two activities in android

I want use single layout xml file for two different activities in android. Is it possible? How can I do it?

0 answers  ·  posted 2y ago by akshayshelke‭

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‭

40%
+0 −1
How to uncollapse the first and second tiers of a link tree in JavaScript?

I wish to display the first and second branches of a link tree with JavaScript. I want to show these branches in a single action, instead of clicking each vertical arrow (link) anew. HTML examp...

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

50%
+0 −0
In angular-imask how do I get the IMask class?

Using Angular-IMask, I'm programatically updating the field that has IMask. So I'm getting the error: "Element value was changed outside of mask. Syncronize mask using mask.updateValue() to work p...

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

83%
+8 −0
How to delete contents of a specific field, if it matches a pattern and there is nothing else in the field

How do I delete contents of a specific field, if it matches a pattern, and there is nothing else in the field? I have a several GB tsv file, and I am interested in a specific field (72). If it cont...

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

75%
+4 −0
How to set FontFamily for an entire WPF application in a theme?

I have a project Anonymised.Theme which contains XAML resource dictionaries for a theme. This is used by about a dozen applications which simply include it by merging <ResourceDictionary Source...

2 answers  ·  posted 2y ago by Peter Taylor‭  ·  last activity 2y ago by aresavatar‭

86%
+11 −0
Should I check if pointer parameters are null pointers?

When writing any form of custom function such as this: void func (int* a, int* b) Should I add code to check if a and b are null pointers or not? if(a == NULL) /* error handling */ When po...

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

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‭

81%
+7 −0
Is there a name for a data format like `key[type]=value`?

I'm working on an integration with a proprietary (black box) system. There is some TCP communication that occurs between two microservices. I've managed to sniff the traffic and it's being sent in...

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

66%
+2 −0
How do I get an animation from another source playing through hovering?

I was tasked with an assignment where I should get a box to move to the 4 corners of the viewport by hovering on a button. Most of the code is already finished except for figuring out how to get th...

0 answers  ·  posted 2y ago by General Sebast1an‭  ·  edited 2y ago by General Sebast1an‭

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
WPF MVVM ListBox not updating

I am trying to combine MVVM in WPF using Microsoft.Toolkit.MVVM. Somethings are working as expected. The text boxes bind to fields and update in both directions. The button command executes and cha...

2 answers  ·  posted 2y ago by FrankLuke‭  ·  last activity 2y ago by elgonzo‭

40%
+0 −1
How To Verify Old Password in PHP? [closed]

I have a page to change the user password in my website, this page can only be used if the user have a logged in! The change password page have 3 inputs: Old Password, New Password and Con...

0 answers  ·  posted 2y ago by rrenildopereiraa‭  ·  closed 2y ago by Alexei‭

37%
+1 −3
Java cannot find class within same package

I've written a class object, QueueObject, but when I try to construct it inside of my main class, it says it cannot find the symbol on compilation. I've read lots of pages saying how misspellings o...

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

28%
+0 −3
C++ exit code -1073740940 [closed]

What means the exit code -1073740940 in C++?

2 answers  ·  posted 2y ago by always_improve‭  ·  closed 2y ago by Alexei‭

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

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

71%
+3 −0
Why does pushing to one array affect all the arrays in my two-dimensional array?

I was trying to initialize a simple two dimensional array as follows: const arrays = Array(3).fill([]); However, when I tried to push an entry into one of the arrays, it seems like it gets push...

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

57%
+2 −1
How can the Caesar cipher be implemented in Java?

The Caesar cipher is a substitution cipher in which the letters of an ordered alphabet are cyclically shifted by a given number. A detailed description can be found e.g. here. Let u be the index o...

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

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‭

71%
+3 −0
Load site based on cookie value in PHP

I need to load a site based on a cookie. I wrote code to validate that, like this. if(!isset($_COOKIE['cookie'])){ $domain = $_SERVER['SERVER_NAME']; setcookie('cookie', $cookie, time() ...

1 answer  ·  posted 2y ago by hajakutbudeen‭  ·  last activity 10mo ago by keyang‭

75%
+7 −1
How to avoid "exception is never thrown" when commenting out a line while debugging

I have a code block like this: try { ... x.foo(); // This is the line that forces us to have the try block ... } catch (ArrayIndexOutOfBoundsException e) { logger.error(e.getM...

1 answer  ·  posted 2y ago by klutt‭  ·  last activity 2y ago by anatolyg‭

71%
+3 −0
Algorithmically generating the grid formed by the vertices of a dodecahedron (Hunt The Wumpus)

I am attempting to write a program to simulate Hunt The Wumpus in the K programming language. The game requires a grid that is created by the vertices of a Dodecahedron, which is cyclic and triangu...

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

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
Conditions which always matches returns no result with CTE

I have the following scenario (in MySQL 8): CREATE TABLE `steps` ( `id` int NOT NULL AUTO_INCREMENT, `number` varchar(30) DEFAULT NULL, `parent_number` varchar(30) DEFAULT NULL, `timestamp` ti...

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

42%
+1 −2
How to create an object, call one of it's methods and pass it as an argument as a oneliner?

Assume I have this class Foo class Foo { private int x; void setX(int x) { this.x = x; } } And I have a Junit test like this: Bar bar; @BeforeEach void setu...

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

62%
+3 −1
How do I strip file extensions from URLs with H2O?

I'm trying to use H2O to serve a multi-file PHP website without routing—just having a separate PHP file for every page. The relevant part of my H2O config currently looks like this: paths: "/":...

1 answer  ·  posted 2y ago by Ullallulloo‭  ·  last activity 2y ago by jminer‭

81%
+7 −0
Console scripts in virtual environment do not output to terminal in git bash

I have console scripts in my virtual environment in \env\Scripts, installed with packages (e.g. black, pytest, coverage). If I try to execute these in Git Bash, the output is not returned to the te...

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