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)
I am writing a Python package where I have two classes in different files that (indirectly) depend on each other. If I wouldn't care about type-hints, there would be no problem, but unfortunately,...
I have a very simple source file -- HelloWorld.java public class HelloWorld { public static void main(String[] args) { System.out.println("hello world"); } } I have th...
Our organization (blindness non-profit in California) is obligated to submit reports to grant organizations (e.g., Department of Rehabilitation) on a regular basis. Most of the time, this means exp...
I've seen macros use parentheses to enclose its arguments. Most of these make sense, as in #define sum(a, b) ((a) + (b)) The outer prevents the following: #define sum_bad(a, b) (a) + (b) ...
Mathematically, the purpose of a function is to return an output. However, in a programming context functions often have side effects. It is even common to call functions for the side effects alone...
I've noticed that a lot of sites have something like this going on: <div class="has-margin-0 has-padding-4"> <div>...</div> <div>...</div> ... </div>...
Context: Azure; Windows Server 2012; IIS 8 First up, here's the (redacted) web.config for reference <rewrite> <rules> <rule name="ReverseProxyInboundRule1" stopProcessing="false"&...
I personally would define "escaping" in software development in general and coding in particular as follows: Making an exception to match data which otherwise would not be allowed to be matched: I...
I have a database with quite a few VARCHAR fields. When the database was first built the lengths of the columns were set a bit larger than absolutely necessary. Now after, having used the DB for a ...
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a comp...
In order to test that coredumps are generated and that they contain useful information which can be retreived with gdb I need to generate a SIGSEGV. Or anything else which causes a coredump. The co...
In programming instead of arrowcode where one has many layers of indented if statements, you can return a result as soon as possible. So instead of, if if end if end if It looks like if ret...
I can't get a response from IPv4 dig on my server but I can get one from IPv6 dig. See the below output: $ dig +short myip.opendns.com a @resolver1.opendns.com # Doesn't return anything, this used ...
I am working at a proof-of-concept for porting an ASP.NET MVC application to an ASP.NET Core API + Angular SPA. One of the features of the existing application is the ability of an admin (typically...
I have some SQL scripts that contain DDL to create tables and schemas for a database. I'd like to be able to comment this SQL and then use those comments to generate output documentation (in HTML)...
In Python, multiprocessing is easy to do if you follow a "list projection" paradigm. Say you want to take a list of inputs X and apply some function f to every x_i, such that y_i = f(x_i) and the y...
I'm trying to set the transform attribute of a group within an SVG. Specifically, I'd like to set translate's value to 0 0. I tried using the set element for this but that didn't have an observab...
In VS Code, is it possible to run Python code on the text being edited? I realize that I can save my text, create a .py file, switch to a terminal (including VS Code's own terminal) and run the .p...
I'm writing a library "MyLibrary". In there, I group code into sections that make sense. Let's say I have a folder "Reports" and a folder "Helpers". I would like to have my code separated while ...
When developing a rust program you build and run using cargo run. However you cannot just append arguments to that as they will be caught (and likely rejected) by cargo itself. So how to pass argum...
Consider the following arbitrarily-nested JSON as input to a jq filter: echo '[{"foo": [1, 2]}, {"bar": [{"baz": ["foo", "baz"]}]}]' | jq '.' My goal is to join leaf arrays into strings: [{"fo...
What would be the simplest (and most lightweight) way of getting email notifications of failures in kubernetes clusters. Mostly interested in failing pods, so notifying on certain kubernetes event ...
A lot of people who maintain FOSS projects would like to get more contributions. What can the maintainer do to ensure that potential contributors are converted into actual contributors? There are...
When I do this in a shell: $ /bin/sh -c 'echo hello world' hello world it's my understanding that I'm running a process with argv = {"/bin/sh", "-c", "echo hello world"}. That is, the quotes c...
The Zip class from Data.Zip requires an implementation of Semialign: class Semialign f => Zip f In my mind: Zip takes the intersection of two shapes. Semialign takes the union of two sha...
I want to add the ability to "Sign in with Google" into a Ruby on Rails web application, that is using Devise to handle authentication. How do I do that?
The last few years, PHP has basically exploded with lots of modern language constructs that makes the life easier. But local constants are still missing, and I find that very strange. I have found...
Many languages discourage global variables. Why is this?
I ran some Python code and it crashed with ModuleNotFoundError. What is the general approach for dealing with these situations?
By default Gitlab CI jobs run on any commit. I would like to restrict some of them to run only on commits to specific branches. How to do this in .gitlab-ci.yml?
I have a SPARQL query to Wikidata that returns the names and handles and parties of politicians for whom a Mastodon address is stored at Wikidata. Filtered by nationality and with an output of the ...
A well-known easter egg in Python displays some ideas about writing good Python code, credited to Tim Peters (one of the core developers). This question is about the last: Namespaces are one hon...
Problem I'm trying to update some projects from old-style .csproj: <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.mi...
Is there any guarantee regarding initialization of static and thread_local objects? In example, is there any guarantee about the value printed by the following program? #include<iostream> s...
I am currently making an esoteric language which requires a theoretically infinite canvas. Basically, it should be able to resize and fit the contents of the drawing in and outside it's existing bo...
How do I create a flag that can be used multiple times in a command using the pflag package? For example, let's say I wanted to select multiple fields and did not want to have to use comma-separati...
Due to a series of unfortunate events I have some tables where the auto_increment value got behind what it should be. If the auto_increment value is 9 and there are 20 rows in the table the next 1...
Summary/Context I'm currently working to improve performance and throughput of our automation infrastructure, most of which is a combination of Bash/Shell scripts, Python scripts, Docker, Jenkins,...
Consider the following code: public class OnlineShoppingService { @Transactional public void cancelOrder(String id) { if (shipmentRepository.findShipmentForOrder(id) != null) { ...
I'm using Doxygen to help me figure out some library code. There's an enum I know I need to use, but I don't know which file it's declared in. Searching for that identifier in Doxygen yields the p...
I have added Swagger UI for an ASP.NET Core 3.1 application and I have realized that all endpoints requiring Windows Authentication fail. This issue is created by the fact that generated HTTP reque...
I'm trying to write an interface to define the set of operations I expect my repositories' Unit of Work implementations to have, and I want this interface to be fulfilled by EF Core's DbContext cla...
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 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...
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 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 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 ...
When working with a qmake subdirs project you may want to share configuration between multiple projects. In a less common case you may including a external project within your own as code and want ...
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 ...