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

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‭

66%
+4 −1
Load environment variables from .env file in Python 3 [closed]

In Python 2, I was able to create a file named .env within a project folder like so: # .env MY_ID=abc123 TOKEN=4567890 Then in a Python file in the same directory, I could read these variable...

0 answers  ·  posted 2y ago by qohelet‭  ·  closed 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‭

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‭

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‭

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‭

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‭

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‭

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

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

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‭

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‭

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‭

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‭

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‭

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‭

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‭

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‭

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‭

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‭

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‭

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‭

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‭

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‭

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‭

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

62%
+3 −1
Comparing two excel files with Python based on changes

I have two tables: Table1: Name Description Amount 123 Description123 123 456 Description456 456 789 Description789 666 101 Description777 101 133 De...

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

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‭

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
DST disrupting rsync twice a year

I'm facing rsync full syncs every once upon a time, I think it's because DST, notice an hour of difference: $ ls -l tier2/VIDEO-2020-06-17-15-10-27.mp4 /Volumes/KINSTON2/dat/laptop_kinstones/tier2...

1 answer  ·  posted 3y ago by .                                                .‭  ·  last activity 2y ago by .                                                .‭

72%
+6 −1
How to unittest method that involves contacting remote servers?

Let's say I have this class: class myService { private boolean foo(T arg) { return arg == 42; } public Response bar(U arg) { if(foo(U.field)) { return Response.st...

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

66%
+2 −0
How to check if a ldap username is valid without contacting the active directory via ldap?

I have some code connecting to an active directory via ldap. Something like this: public Response add(User user) { try { LDAPConnectionPool ldapPool = ldapConnectionPool.getPool();...

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

40%
+2 −4
How do I properly format a String for parsing with a com.google.gson.JsonParser

I am trying to check a JSON array for a certain element. However, when I try to instantiate a JsonElement to search the list for: JsonElement builderElement = JsonParser.parseString( "{\"disc...

0 answers  ·  posted 2y ago by cuzzo‭  ·  edited 2y ago by Stephen C‭