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)
75%
+4 −0
Dealing with code maintenance when saving a large and complex entity in a single business transaction

Context I am currently working on migrating a legacy application to an ASP.NET Core + Angular application. The Web API's main project is based on Jason Taylor's template (clean architecture) and a...

1 answer  ·  posted 1y ago by Alexei‭  ·  last activity 1y ago by r~~‭

75%
+7 −1
How can I provide additional information when raising an exception?

Suppose I have some code like: filename = "bad_dir" print(f"File not found: {filename}.") raise(FileNotFoundError) When the exception isn't caught, the stack trace is printed at the end of ...

2 answers  ·  posted 1y ago by mcp‭  ·  edited 3mo ago by Karl Knechtel‭

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‭

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‭

75%
+4 −0
How to configure .gitignore to ignore all files except a certain directory

MWE In the terminal run: mkdir mwe cd mwe mkdir dir touch f1.txt f2.pdf dir/f1.txt dir/f2.pdf git init . Create a .gitignore with: * # ignore all !dir/ # except this directory ...

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

75%
+4 −0
How to programmatically get current wallpaper file path?

I have written a screensaver program that, in part, uses the current wallpaper for some visual effects. However, finding the current wallpaper in different operating systems and environments is les...

1 answer  ·  posted 1y ago by ghost-in-the-zsh‭  ·  last activity 1y ago by ghost-in-the-zsh‭

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‭

75%
+4 −0
Is it possible to write protocols for enumerations in Python?

Having recently learned about protocols in Python, I now wonder if you can write a protocol for enumerations. That is, a protocol that says that you are supposed to pass an enum that has certain it...

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

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‭

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‭

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‭

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‭

75%
+4 −0
How to clear the contents of a file?

How to clear the contents of a file using C?

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

75%
+4 −0
Appropriate HTTP status code for "user confirmation required"

I'm working on a system where the frontend will make a call to the backend to perform an action. Sometimes this action can cause other unintended consequences (like charging the customer), in thes...

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

75%
+4 −0
In the current development context (2020+), is there any reason to use database triggers?

I have not used a database trigger in years in the projects of the teams I have worked in, but I have seen them being used by other teams. Back in 2009, it seemed like a heated debate, but I am wo...

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

75%
+4 −0
What advantages does Agner Fog's VCL have over OpenMP?

Agner Fog has this C++ Vector Class Library, which is ... useful for improving code performance where speed is critical and where the compiler is unable to vectorize the code automatically in an...

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

75%
+4 −0
How to align my content to the left?

This revolves around images. I'm trying to write an HTML page of COVID-19 safety procedures, and here's what I've written so far: <!DOCTYPE html> <html> <head> <title&...

2 answers  ·  posted 2y ago by General Sebast1an‭  ·  last activity 7mo ago by Peter Taylor‭

75%
+4 −0
What are the disadvantages of using auto mapper libraries?

I have noticed that lots of projects (both in real-world and within online courses) use Automapper to map domain models to view models, API models. The main advantage seems to be convenience by re...

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

75%
+4 −0
Add single element for multiple keys to map

I have a map and a new item to add to the map and a list of keys I want to attach the new item to: => m1 {:a 1 :b 2} => itm 3 => ks [:c :d :e] => m2 {:a 1 :b 2 :c 3 :d 3 :e 3} ...

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

75%
+4 −0
What are the disadvantages of using SQL Server Replication - Transactional Replication type?

The context A reports related process is directly reading the production operational database once about two hours. This involves reading all the data from some 70 tables which takes a couple minu...

0 answers  ·  posted 2y ago by Alexei‭

75%
+4 −0
Get the length of a slice from a multi-dimensional array

If I have a one-dimensional array, I can get the length of it quite easily: var x = moves.Length(). However, if the array is multi-dimensional, .Length() returns the total number of elements. If ...

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

75%
+4 −0
What determines where the focus goes back to when clicking on a browser's back button?

As far as I can tell, it is in part determined by the HTML spec's History API1, specifically the value of history.scrollRestoration. Quoting the HTML spec's scroll restoration mode paragraph: ...

0 answers  ·  posted 7d ago by toraritte‭  ·  edited 4d ago by toraritte‭

75%
+4 −0
How to prompt a user for an expanded variable in Bash?

I work with CentOS operating system and my only shell is Bash. I want to create a script which prompts a user with a question like "What is your web application root?" The user should answer dire...

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

75%
+4 −0
What are the risks of using iFrame as a temporary migration step for an internal web application?

Overview Our development team is currently trying to develop and migrate a Web application that is split in two: legacy: ASP.NET MVC 5, jQuery, old-style JS programming overall "next": Angular...

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

75%
+4 −0
How to generate multi-line completions (code generation) with OpenAI?

I have finally received access to a trial account on OpenAI and I took it for a spin. My interest is with code generation, so first tried something simple using the playground: Q: generate a stand...

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

75%
+4 −0
How can I customize the default project templates, or create my own, in Android Studio 4.2.1

I want to remove a deprecated entry from the default build.gradle file as well as change the default layout of an empty activity to use Relative Layout instead of constraint. I'm using Android Stu...

0 answers  ·  posted 3y ago by TecBrat‭

75%
+4 −0
Changing the font of a certain cell within a JTable

I am trying to change the font type and size in a JTable cell. Ive looked at tons of posts and while most don't produce stack traces, they don't seem to do anything either. Here is the code I curr...

1 answer  ·  posted 3y ago by cuzzo‭  ·  edited 3y ago by cuzzo‭

75%
+4 −0
Pros and Cons of different tacit systems?

As a big fan of tacit/point-free programming in general, I'm looking at different tacit programming systems for inspiration (for a language I'm creating). What are the advantages and disadvantages ...

0 answers  ·  posted 3y ago by Wezl‭  ·  edited 3y ago by Wezl‭

72%
+6 −1
Which abstraction should I choose for background services and why?

Which concept is best for managed background services? 1. RunAsync(CancellationToken): interface IWorker { Task RunAsync(CancellationToken cancellationToken = default); } ... IWorker worker =...

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

72%
+6 −1
What are the pros and cons of using objects vs associative arrays for JSON results of a CURL request in PHP?

I have a PHP script that uses CURL to return a JSON result that looks //Curl set up code $result = curl_exec($ch); //Error checking code $json = json_decode($result, true); //Code to process r...

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

72%
+6 −1
How to separate DB query logic from the application other than implementing a repository on top of an ORM?

I've been doing a lot of reading on implementing the repository pattern in C# projects and found controversy, or shall I say some strong criticism, made by seemingly very smart people with previous...

1 answer  ·  posted 3y ago by Marc.2377‭  ·  last activity 3y ago by Alexei‭

72%
+6 −1
Best practices in setting up a development & production environments

I am developing a web app that is tied to a database. My codebase is stored on a private GitLab instance. I would like to set up a workflow that would look something like this: I have a developm...

1 answer  ·  posted 2y ago by Mu3‭  ·  last activity 1y ago by Mithical‭

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‭

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‭

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‭

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‭

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‭

71%
+3 −0
How to write a macro that discards the const qualifier, for any type?

How to write a macro that discards the const qualifier, for any type? I hope some combination of typeof and a cast will do, but haven't found the combination. I tried this, without luck: #define...

2 answers  ·  posted 2y ago by alx‭  ·  last activity 1y ago by alx‭

71%
+3 −0
How to allow sign-ups without confirmation as an exception using devise confirmable?

I use the devise authentication gem for a Rails application and it's very convenient. Typically I want my users to confirm their registration by email. Therefore the User model looks like class U...

1 answer  ·  posted 2y ago by Trilarion‭  ·  last activity 2y ago by ArtOfCode‭

71%
+3 −0
Assert that some code is not present in the final binary, at compile or link time.

I'd like to assert that some code can be optimized out, and is not present in the final binary object. #define CONSTANT 0 #if (!CONSTANT) [[landmine_A]] #endif static int foo(void); void...

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

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

71%
+3 −0
How to correctly daemonize a Rocket-based app?

Summary I'm refactoring a Rust-based service/daemon to move away from gRPC and use a Rocket-based API instead. I'm also using the daemonize crate to turn the foreground process into a background p...

1 answer  ·  posted 2y ago by ghost-in-the-zsh‭  ·  last activity 1y ago by ghost-in-the-zsh‭

71%
+3 −0
How to calculate how much data is stored in a MySQL column?

I am considering either removing some columns or changing the datatypes if I could significantly reduce the amount of storage that is currently used by those columns. Some of the columns are ints a...

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

71%
+3 −0
Error: 18456, Severity: 14, State: 5; SSMS > Network sever from PC

I just completed my first install of SQL as a server-based, Enterprise Edition. I wanted to check it out using SSMS on PC using my Admin Access. But could not connect. For security reasons my adm...

1 answer  ·  posted 3y ago by James Jenkins‭  ·  edited 3y ago by Alexei‭

71%
+3 −0
Can renaming a MySQL column be sped up by dropping indexes or foreign keys?

I need to rename one column in 170 tables in a MySQL database and its going really slow. The columns all have an index plus a foreign key on them, would dropping the index/temporarily removing the...

2 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by manassehkatz‭

71%
+3 −0
What options can be set via swing.properties?

The default Swing look and feel can be set in $JAVA_HOME/conf/swing.properties What else can be set in this file? I can't find any other documentation of it.

1 answer  ·  posted 3y ago by ajv‭  ·  last activity 3y ago by Stephen C‭

71%
+3 −0
connect with SLOT/SIGNAL: QPushButton clicked signal not received by main window

I added a QPushButton to my ui file named pushButton, and manually connected it using connect. There are no errors or warnings emitted at any point in the compilation stage The button does show up...

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

71%
+3 −0
Include a Blazor Webassembly project into an existing ASP.NET Core project

When creating a new Blazor Webassembly project, there is a checkbox ASP.NET Core hosted where if selected will create three projects at once, a blazor webassembly project, an ASP.NET Core project, ...

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

71%
+3 −0
How long in days is a MONTH in MySQL?

If one finds where the past number of months equals the past number of days like this, select distinct DATE_SUB(now(), INTERVAL 92 DAY),DATE_SUB(now(), INTERVAL 3 MONTH) The numbers that are curre...

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