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.
Search
Arguments in favour of "struct tag style": Less namespace clutter. C has a peculiar name space system where all identifiers belong to one of: labels, tags, members, ordinary. Struct tag style...
C offers two different styles when it comes to structs (and union/enum too). Either declare them using a struct tag only ("struct tag style"): struct my_type { ... }; struct my_type x; Or ...
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...
The safe way: [1] git branch --delete <branch-name> It will fail if the branch isn't merged. If this is ok then you can delete it anyway like this: [2] git branch --delete --force <br...
This is pretty much exactly what formail is good at. Specifically useful for this case, formail lets you extract headers, given an email message on RFC 822-esque format. In bash, if you have the ...
You can do that by letting the required attribute evaluate true only when the form's main submit button is invoked. First bind the submit button component to an unique variable in page's EL scope ...
Apparently, my form was inside an iframe. In order for me to redirect I had to change location of parent document, like so: <script type="text/javascript"> if (window.self != window.top...
GitHub has a setting wherein they offer to "anonymize" your user email from, say, somebody@example.com to somebody@users.noreply.github.com. I presume this is to prevent you from getting spam from ...
How to do it Yes, Python has an equivalent operator. However, it's spelled with keywords rather than punctuation, and it uses a different order of operands. It looks like: condition_value if some...
The current project I am working on consists of a bunch of microservices (Web APIs) accessible only internally using Entra ID (formerly Azure ID). To simplify the development, all services expose ...
The assumption of 1k attempts/s is wishful thinking, as is the idea that a hacker will go on mail.google.com and try to guess your login (they would get a captcha after like 5 failed attempts). Pa...
In a C implementation in <stdio.h> on Linux I saw something like: extern FILE *__stdinp; extern FILE *__stdoutp; extern FILE *__stderrp; And then: #define stdin __stdinp #define stdou...
The default port is 3306. MariaDB is a fork of MySQL, and this is the default port for MySQL as well. Source.
The main issue with your approach is that, in some cases, you execute a lot of queries to fetch the data. When working with SQL (regardless of relational flavor), you must aim from a set-based appr...
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 ...
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?
Well it was easier than I thought: git diff stash A note about the direction: This will show things which are present in the working directory but not present in the stash as added +. And vice ...
3rd Option: You put a web server like Nginx, etc in front of your application server which can also handle 'raw' network traffic. Even in the PHP scenario this is common. There are a few reason I ...
Found an article about starting a repo with an empty commit. Read the post a couple of times, but still don't understand the reasoning: 1. git log and other commands blow up with terrifying ...
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...
All of these projects use Microsoft's OpenXML SDK for Office behind the scenes: 1. .NET (F#, C#) The F# Guide recommends NPOI, which also seems to be the most popular and most up-to-date, but the...
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) ...
TL;DR: Use wslpath and hope for the best. You can use it like this in Powershell: wsl wslpath -u 'C:\\some\\path\\to\\folder\\or\\file.txt' Long answer Converting them is hard. There is windows...
According to the standard (C17 draft, 7.22.3.2) The function calloc void *calloc(size_t nmemb, size_t size); "allocates space for an array of nmemb objects, each of whose size is size [and] i...
I want my CLI Python program to schedule a task, and then exit. After some times has passed (say 10 minutes) the task should execute. The task can be a Python method or a shell command, whatever i...