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)
In Excel I would like to concatenate several strings into one. I could type and fill in the blanks CONCATENATE(A1, A2, ....) but it is a lot of work This would be cool, but it does not work CONCATE...
Sometimes, either to reduce the amount of typing big table names or when joining a table to itself one will need to alias a table. Personally I find SQL statements with aliases harder to read and a...
I have a number of command line PHP scripts that are either run by a user or by Windows Task Scheduler. These scripts use DB and API credentials and I am wondering if there is a better way of stori...
I found a confusing construction in several stored procs in an MS SQL 2008 R2 database: DATEADD(dd, 0, DATEDIFF(dd, 0, some_date)) As I understand it, these are the relevant function signatures: D...
Note: This is basically a question from Stack Overflow that was closed for a very long period of time and I fear it might get closed again as primarily opinion based. I am wondering if my ASP.NET C...
When using Result or Option to get a value, the value is wrapped in a Ok or Some. For example, with pattern matching to get a Result: let var: Json = match serde_json::from_str(&my_string) { ...
Whenever I search in google why a specific language is interpreted language, I get differences between compiled languages and interpreted languages but nowhere the benefit for being interpreted rat...
I am building an Android app to perform a DICOM C-Echo. (DICOM is a standard for storing and transferring medical images; the specification is at dicom.nema.org). My purpose is to learn more about ...
Summary I'm building an internal system (hardware simulator, using Rust) to help test some Python-based services that talk to hardware. (The services talk to hardware via TTYs.) To trick the Pytho...
There are two broad types of build environments - in-source and out-of-source. "In-source" means the compiled files will appear in the same directory as source files. "Out-of-source" means there is...
The problem I am working on a simple drawing app for Android. I have a custom view on which the user can draw. This means that a lot of data (a list of points) is generated in this View. I want t...
I'm trying to parse lines like "THIS. THAT..OTHER " so that "THIS. THAT." is found. There can be more than one <word><dot> separated by a space except no space after the last one. ...
There is an external program I'm calling from within my C/C++ program, by using fork() and execl(), and redirecting the stdio with dup2() to be able to read the output from the external program. I...
Can anyone explain to me why my Haskell function gives rise to a type-definition error? Originally, I wrote the following function to subtract one from the first n elements in a list: dec_first :...
I have a dataset of car bookings like this: car_id user_id 1 1 2 1 1 2 3 3 1 2 3 3 In this dataset, two separate groups/sets of cars and users...
After upgrading a Web application from ASP.NET Core 3.1 to ASP.NET Core 5.0, it worked fine on an existing server. However, when deployed on a server that had only .NET 5.0 installed, the applicat...
I'm using SimpleDateFormat to parse a string containing a date/time, but the result has a different date, hour, minute, second and millisecond: SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM...
Making a Nannou App that draws a line to the screen. My model only contains the window itself and a vector of tuples describing the points and color. Similar to this example(under Drawing Lines) ...
Building a Nannou App from their template. I want a circle to slowly fade in color and randomly change color when hitting the boundary of the window. But there is something strange going on when ...
C prohibits accessing an array out of bounds even if measures were taken to ensure that what should lie outside those bounds were known: struct MyStruct { int x[2]; int y, z; }; static...
What are the differences between git apply and git am commands? Both seem to be used for applying patches to repositories. When should one be used over the other?
In Vim, it's possible to tell it to read from stdin instead of a file, by using vim -. This is so that you can pipe the output of one command into Vim, to view/edit it there. The problem I'm facin...
A person I used to work with several years ago was hired to rewrite a product using a .NET-based modern tech stack. One of the aspects that stroke me was that he believes that the product should mo...
I have an ASP.NET Core 5 web application that provides functionality that involves file upload + rather large processing (memory consumption mainly). After each processing (with success or not) the...
Consider this code: #include <stdio.h> int main(void) { static void *ptr; if(ptr == NULL) puts("It's NULL!"); } I wonder if this is guaranteed to print "It's NULL!" I know ...
When using the Array.prototype.sort method, we can pass a compare function as argument. Then, this function can be used to process array's elements, so the comparison is made using some custom crit...
I have recently stumbled across the Maybe (or Optional) modal usage in .NET Code: example code or this one example article Based on everything I read, there are multiple advantages on relyi...
In git you can put your current changes aside for a moment with git stash. This is really neat but what often ends up happening is that you forget what was in there, and what was the state of the b...
Among other things, a URL consists of a host and a path: I was wondering (and couldn't find anything) if there's a name for the combination of host and path. Is there a name for these: examp...
When reading about various operators used by programming languages, the term "short circuit behavior" is often used. For example in this C code: int a = 0; a && b++ Someone explained t...
Let's say I have a client/server application with a data structure on the server side: type User = { name: string; superSecretGovernmentIdNumber: string; }; These fields are both non-nul...
Why does git merge take the source branch rather than the destination branch as a parameter? The most common merge case by far for me is "Okay, this branch looks good, let's merge it into branch X...
Background This is kind of a subquestion to How to properly use malloc? When allocating, there are basically two common ways of using the sizeof operator: int *p; p = malloc(n * sizeof *p); /...
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<...
Let's consider the following code: const char a[][4] = {"aa", "aaa"}; const char *b[] = {"bb", "bbb"}; const char *const c[] = {"cc", "ccc"}; For shared libraries, both b and c arrays require...
I've created a function that calls scanf passing a void pointer as argument: void read(const char *format, void *p) { scanf(format, p); } And tested it with different types: int n; read...
I rent a shared-hosting environment with CentOS-Bash, Apache, PHP, MySQL and a web-based IMAP email client (Roundcube) and some more tools, on which I host my personal website; I don't have Cpanel...
I'd like my web front end to be accessible, including to people who use screen readers. I know the basics about labels and alt text for images, but there are some areas where I'm not sure what a s...
I wish to fill an array with strings, using Bash scripting. The strings are in a file, one per line. Here is what I've tried: declare -a my_array=() while read line; do my_array+=( "$line"...
Background I can see the need to use { } when implementing a function-like macro such as this one: #define HCF(code) fprintf(stderr, "halt and catch fire"); exit(code); Because if we use the f...
C# language version 8.0 introduces limited support for static methods, operators, etc. in interfaces. However, there are still limitations. I was hoping to use the new language features to try a ge...
I'm trying to understand the purpose of the wait() function in Class future<> for C++. At the moment I don't see any purpose for calling wait() instead of get(). What I have tried in code: i...
I have tables A and B and then I have a many to many join table with foreign keys to both called a_b. Neither foreign key can be null and the combinations for the foreign keys to A and B are unique...
Is it worth using the Java Platform Module System introduced in Java 9 to structure application code? Given that the Java Platform Module System introduced in Java 9 doesn't manage dependency vers...
I have a mobile-only HTML contact form divided in source code into three sections; each section should contain fields by a different context. <!DOCTYPE html> <html> <head> ...
How can one differentiate what is or is not a *nix operating system even if that operating system (or its core/shell/common-utilities) allegedly behaves like any "other" *nix operating system? Is ...
I have a parent-child relation in my table, with possibly circular cases. Is it possible to break the infinite recursion in CTE checking values of all previous rows? I would need something like thi...
In the C program below, I make a mistake and call the function with (ld, ld) instead of (d, ld). #include <stdio.h> #include <limits.h> void print_int_long(int n, long l){ pri...
I want to match standard email syntax (lowercased English, numbers and perhaps also some hyphens and underscores) with regex for a sed operation that matches and changes a single email address insi...
How to delete a branch from a remote in git? E.g. maybe you had this branch locally too, but you deleted it already according to this question. Now you want to get rid of the corresponding remote ...