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)
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...
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 ...
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 ...
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...
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 ...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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&...
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...
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} ...
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...
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 ...
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: ...
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...
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...
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...
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...
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...
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 ...
Which concept is best for managed background services? 1. RunAsync(CancellationToken): interface IWorker { Task RunAsync(CancellationToken cancellationToken = default); } ... IWorker worker =...
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...
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...
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...
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...
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...
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...
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() ...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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.
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...
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, ...
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...