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)
66%
+2 −0
What are the cons of directly mocking Entity Framework DbSets instead of working with an in-memory database when unit testing the application?

I have recently contributed to a Clean Code project and had a discussion about how to implement unit tests. The project author argues for using an in-memory database (which easily replaces the rea...

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

66%
+4 −1
How can I write an egrep (grep -E) regexp that matches lines containing two stanzas in arbitrary order?

I have line-based data on the form x1=y2; a3=b4; c5=d6; ... Matching this with a extended regular expression is fairly straightforward; for example, one can do something not entirely dissimilar...

3 answers  ·  posted 3y ago by Canina‭  ·  last activity 3y ago by hkotsubo‭

66%
+2 −0
Tampermonkey userscript prevents pages from loading

I am currently making a userscript to interpret the APL programming language in a Stackexchange chat window. This is the code I have come up with: // ==UserScript== // @name APL chat // @ver...

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

66%
+2 −0
Is it possible to disable the "mysql: [Warning] Using a password on the command line interface can be insecure" warning?

For my purposes, it is secure enough to use passwords to execute MySQL commands on the command line, what I would like to do is disable the warning that says, mysql: [Warning] Using a password on ...

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

66%
+2 −0
Confusion about using std::async with class member function

So,I'm having a doubt when I call std:async() on a member function of a class. The book I'm reading says (emphasis mine) You can also pass a pointer to a member function to async(). In that case...

1 answer  ·  posted 3y ago by hamsasimon‭  ·  last activity 3y ago by Chris Jester-Young‭

64%
+9 −4
Is omitting braces for single statements bad practice?

Consider this code: while(arr[index] != 0) index++; vs while(arr[index] != 0) { index++; } Personally, I prefer the first. The fact that the braces are not needed makes them -- u...

6 answers  ·  posted 3y ago by klutt‭  ·  last activity 8mo ago by H_H‭

63%
+5 −2
Prevent vscode from inserting new lines in the middle of my code on format.

I am cleaning up java code in vscode to make it more readable. When I format my document there are instances when vscode inserts new line character when I don't want it. Here I show 2 examples of w...

1 answer  ·  posted 10mo ago by Vanity Slug ❤️‭  ·  edited 10mo ago by Vanity Slug ❤️‭

63%
+10 −5
Is it wrong to demand features in open-source projects?

I have been using open-source software, and the open-source Community is great at maintaining such projects. But I have observed something in smaller open-source projects. Whenever I demand some f...

3 answers  ·  posted 3y ago by theabbie‭  ·  edited 8mo ago by tripleee‭

62%
+3 −1
How do I choose the correct Perl module from these variations?

When looking for Perl modules to handle JSON strings and/or documents, I found JSON::PP and JSON::XS. The documentation of JSON::PP says it is compatible with JSON::XS. What do these suffixes me...

1 answer  ·  posted 3y ago by ghost-in-the-zsh‭  ·  edited 3y ago by ghost-in-the-zsh‭

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

62%
+3 −1
Are there practical reasons for designing a method-only class/object?

Are there practical reasons for designing/implementing a method(s)-only class/object? Follow-up background notes: This question is for languages that are not exclusively Object-Oriented, for exam...

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

62%
+3 −1
Is the concept of a PHP lint feasible?

When I review JavaScript files in various text editors (Visual Studio Code, Greasemonkey/Tampermonkey) I sometimes get notified about syntax errors. I never encountered this behavior with PHP file...

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

php
62%
+3 −1
PHP emails are sent when $message is a string, but not when its an array

I host my website on a CentOS-Bash, PHP and MySQL environment; my local email client is engined by Roundcube. I don't know almost anything about PHP nuances. While my web domain registration is do...

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

php
62%
+3 −1
Is this a known design pattern: a piece of code is responsible for acting as a central proxy for data distributed in various places?

I have several classes (C_1...C_n) and their instances (I_1....I_m). I have a "Registry" R of these. There are several pieces of data (d_1...d_k) spread across various instances. This much is set ...

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

62%
+3 −1
Reading contents of XML node

I'm writing some functions in C that parses a part of a XML file (using libxml), but instead of extracting the content of the XML node that has a specific name, it outputs a string that's not in UT...

0 answers  ·  posted 3y ago by southernisles‭  ·  edited 3y 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‭

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

62%
+3 −1
How does a client verify a server's SSL certificate? What are the specific steps?

I have little to no idea what happens after a client obtains the server's certificate. It has to make sure that it (somehow) valid, but how?

1 answer  ·  posted 5mo ago by toraritte‭  ·  edited 5mo ago by toraritte‭

62%
+3 −1
What happens when you “Sign in with Google”?

I believe when you sign in with Google, the web application running in your browser calls a command to request the Google Sign In page, and includes a “callback URL” as a parameter in that HTTP req...

0 answers  ·  posted 2mo ago by Julius H.‭  ·  edited 2mo ago by Julius H.‭

62%
+3 −1
What is the difference between a hook and a code injection?

I would define a hook as: A piece of code which changes the response to a certain event, without changing the original code that caused the event How is that different than "code injection", if a...

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

62%
+3 −1
What's the difference between null pointers and NULL?

Someone told me that I shouldn't write "NULL pointer" with capital letters, because a null pointer and NULL are different terms. And that NULL is a "null pointer constant". What's the meaning of th...

3 answers  ·  posted 3y ago by Lundin‭  ·  last activity 3y ago by EJP‭

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‭

62%
+3 −1
java.lang.UnsupportedClassVersionError: when trying to connect to JDBC with JDK 14 in Eclipse

I'm trying to connect to a db file in my project but having some troubles. I'm using JDK 14 with ojdbc11 however I am still getting this when trying to connect: java.lang.UnsupportedClassVersionEr...

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

62%
+3 −1
cannot initialize a variable of type 'CFDictionaryRef'

Background story: I'm on mac OS 11.6 and would like to access an identifier for the current space/desktop from the command line. I found a helpful article at https://ianyh.com/blog/identifying-spac...

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

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 remove an element from a Java array?

One way to remove element from array is to replace element with zero. Below is a rough snippet I am sharing: int N = sc.nextInt(); int pos = sc.nextInt(); int A[] = new int[N]; if(pos == i) { ...

1 answer  ·  posted 7mo ago by abhinavxyz‭  ·  edited 7mo ago by E_net4‭

61%
+6 −3
Why are commas not needed for modulo string formatting when printing?

Suppose I have two variables that are called animal and age, and print them as a string in the console like so: animal = "giraffe" age = 25 print("A %s can live up to %d years" %(animal,age)) ...

3 answers  ·  posted 1y ago by Bennshinpoes‭  ·  edited 9mo ago by Karl Knechtel‭

60%
+1 −0
How to solve the "ReferenceError: service is not defined"?

Temporary notice: this is part of an ongoing project of transferring and splitting my canonical from Stack Overflow on common errors in Google Apps Script. As soon as the Q&As are finalized, ...

1 answer  ·  posted 9mo ago by Oleg Valter‭  ·  last activity 9mo ago by Oleg Valter‭

60%
+1 −0
Relayout call does not work on button click in Factor

I am currently using this code to display a GUI counter: USING: accessors arrays fonts kernel math math.parser ui ui.gadgets ui.gadgets.buttons ui.gadgets.editors ui.gadgets.labels ui.gadgets.pa...

0 answers  ·  posted 1y ago by Razetime‭  ·  edited 1y ago by Razetime‭

60%
+1 −0
`git submodule foreach git pull` in parallel

I use git submodule foreach git pull to update my submodules. There's quite a few and it appears that foreach is updating them one by one, instead of in parallel. How can I do it in parallel?

1 answer  ·  posted 9mo ago by matthewsnyder‭  ·  last activity 8mo ago by GrantMoyer‭

60%
+1 −0
How to call static methods in ColdFusion?

How to use static functions in ColdFusion? How to import component? How to call a static function using both tag and script syntaxes? Adobe added support for static functions in ColdFusion...

0 answers  ·  posted 9mo ago by Vanity Slug ❤️‭

60%
+1 −0
How to find the existing default action for a UI gadget in factor

For a UI gadget like a $link in Factor, a click automatically opens the page that it points to. I want to know where this default behaviour is defined. In the factor documentation, there are many ...

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

60%
+1 −0
What can be used in react-native instead of an html label tag to achieve the same result?

I wanna make a form in React native. A field in this form in (non-native) React would be like this: <div> <label htmlFor="lastName">Last Name:</label> <input type="text...

0 answers  ·  posted 9mo ago by andre‭  ·  edited 9mo ago by andre‭

60%
+1 −0
How to import a vocabulary's test file in factor.

For example: I have noticed that this does not work for any vocabulary's tests. What is the alternate way to USE: these test vocabularies? EDIT: The test word appears to run all tests alongside...

0 answers  ·  posted 1y ago by Razetime‭  ·  edited 1y ago by Razetime‭

60%
+1 −0
How to use ReactNative SDK with flexible sync using a code first approach

I am working on a React Native app using Realm, Atlas Flexible Sync, and MongoDB, and I'm super confused about how subscriptions work. I'm coming from a .NET SQL background, so I'm completely new t...

0 answers  ·  posted 1y ago by Scriptastrophe‭  ·  last activity 1y ago by Mithical‭

60%
+1 −0
What is lifting state up in Flutter?

What does lifting state up in Flutter mean, and how does it work?

1 answer  ·  posted 10mo ago by tarhalda‭  ·  last activity 10mo ago by tarhalda‭

60%
+1 −0
Ignore NPM Modules Digital Ocean App Platform

There may be a better way to manage website's with JavaScript deployments. I added jest to my repo simply to execute tests when I make PRs as part of a GitHub action. This requires a package-lock.j...

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

60%
+1 −0
How to use Ansible extract filter in map with an external dictionary

Ansible's extract filter is supposedly made for use in map, but at the time of writing the documentation doesn't actually show how to use it together with the map filter. The following outputs VAR...

1 answer  ·  posted 7mo ago by Iizuki‭  ·  edited 7mo ago by Iizuki‭

60%
+1 −0
Ghidra decompiler: c_str() used in phantom string?

I loaded a binary into Ghidra for analysis. The decompiler says undefined8 main(void) { basic_ostream *pbVar1; char *pcVar2; [--snip--] pbVar1 = std::operator<<(pbVar1,"PXZ ");...

1 answer  ·  posted 6mo ago by nteodosio‭  ·  edited 5mo ago by Alexei‭

60%
+1 −0
Issues with receiving WM_INPUTLANGCHANGE etc. messages when language is chosen using hotkeys

I'm currently writing an input and output handling library for the D language, and I'm not getting any kind of input language change messages when the language is being toggled with hotkeys, and on...

1 answer  ·  posted 9mo ago by ZILtoid1991‭  ·  edited 9mo ago by Karl Knechtel‭

60%
+1 −0
Command to format code from repo into single markdown file

I'm trying to flatten a repository of Python code into a Markdown file where each file is formatted like: relative/path/to/file1.py # contents of file1.py I'm using this command: find . -name...

2 answers  ·  posted 6mo ago by ShadowsRanger‭  ·  last activity 3mo ago by Michael‭

60%
+1 −0
How do I register the Chart.js Zoom plugin?

I am attempting to use the chartjs-zoom-plugin v2.0.1 with Chart.js v4.4.0. I have the plugin as the file chartjs-plugin-zoom-2.0.1.min.js, and I have imported it into my page using <script ty...

1 answer  ·  posted 7mo ago by CavanWright‭  ·  last activity 6mo ago by surajrao‭

60%
+1 −0
Optimized representation for sets?

I need to do a lot of calculations involving sets. There are relatively few values in the "universe" of candidates that could appear in any of the sets, but potentially very many such sets (they mi...

1 answer  ·  posted 8mo ago by Karl Knechtel‭  ·  last activity 8mo ago by Karl Knechtel‭

60%
+1 −0
How to put text next to my ImageIcon on a cell in a JTable

I have an application that works with a JTable, and in this JTable, I want each cell to have both an ImageIcon and some text. I see at this link, JTable supports ImageIcon OR text, but seemingly n...

1 answer  ·  posted 8mo ago by davidalayachew‭  ·  edited 8mo ago by Alexei‭

60%
+1 −0
How to validate Ansible role dictionary argument's "additionalProperties"

In JSON Schema one can use the additionalProperties key to validate properties whose names are not know. You can still impose restrictions on their type. How to do this in an Ansible role argument...

1 answer  ·  posted 7mo ago by Iizuki‭  ·  edited 7mo ago by Iizuki‭

60%
+1 −0
Shortcut for inserting today's date in VS Code

Is there a way to easily insert today's date when editing a file in VS Code?

1 answer  ·  posted 7mo ago by matthewsnyder‭  ·  last activity 7mo ago by matthewsnyder‭

60%
+1 −0
Can't use tf.timestamp() from within @tf.function with XLA / jit_compile=True

I would like to use tf.timestamp() when it is available (eager mode and graph mode without XLA), and use 0. (or a better fallback if there is one) when it is not available (with XLA; @tf.function(j...

0 answers  ·  posted 8mo ago by daniel_s‭

60%
+1 −0
How to delete a local branch in git?

How to delete a local git branch which hasn't been pushed to anywhere, and only exists locally?

1 answer  ·  posted 7mo ago by Iizuki‭  ·  edited 7mo ago by Iizuki‭

60%
+1 −0
Tidy Ansible assert module loop output

Looping in Ansible usually produces a neat output of one line per iteration (per host): ... ok: [Arch] => (item=something) ok: [Arch] => (item=something_else) ok: [Arch] => (item=yet_a...

1 answer  ·  posted 8mo ago by Iizuki‭  ·  edited 8mo ago by Iizuki‭

60%
+1 −0
How do I install Chart.js as a file?

I'm trying to replace Flot.js with Chart.js. In my application, Flot.js is included as a normal JavaScript file, like so: <script language="javascript" type="text/javascript" src="jquery.flot-...

1 answer  ·  posted 7mo ago by CavanWright‭  ·  last activity 7mo ago by Ullallulloo‭