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.
Posts by matthewsnyder
Recently, AI models like ChatGPT have shown themselves capable of generating content and even source code. Just like with human helpers, clear and precise communication is key (especially when aski...
It sounds like you have a Java formatter configured (by default?) and VSC is applying it to your code automatically (on save?). How code is formatted If your only gripe is these specific stylisti...
I have a git repository with some submodules. When the submodule repos get new commits on the remote, how can I pull them all?
New LLMs like ChatGPT are now creating competition with Q&A sites like Codidact and StackOverflow. Moreover, this is parasitic: LLMs get "boosted" by Q&A sites because they can use them for...
My take on this: Q&A sites used to fill two distinct roles, but only one of these (the more boring one that doesn't matter anyway) is usurped by LLMs. The interesting one is not yet in danger o...
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...
When I open VS Code inside a project dir, it reopens all the tabs that were open last time, and re-expands all the folders that were unfolded last time. I find this annoying. Usually, when I close...
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?
You don't need a regex for this. To find first you can simply iterate through the line until you find a digit. To find second you can do the same but in reverse. This is more efficient than running...
Create a hash map and precalculate the sort key in it: // Set up: Create mock input let u = ['4', '16', '8', '2', '6']; function expensive_key_fn(x) { console.log("Doing expensive operation...
When printing Markdown text to the terminal, how can I get a bit more formatting so it looks nicer? I realize that this is a bit of a contradiction, since terminals generally use only one font. Bu...
When you try to do a privileged systemd operation without the privilege, you get an escalation prompt: $ systemctl stop docker ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ==== ...
I am trying to generate my own root CA certificate. Context My goal is to sign an intermediate CA with this certificate, and then install the intermediate CA on my own client machines. The interm...
PEP20 aka the Zen of Python has a statement: Namespaces are one honking great idea -- let's do more of those! What exactly are we supposed to "do" according to this? Is it saying we should h...
VS Code supports regex search, but the search/replace UI is just a tiny dialog box. It's okay if you know regex well and the expression is not complex, but when trying to apply complicated expressi...
When you do: cd /some/path code . VS Code opens with that location shown in the "Explorer" sidebar. However, the state of the file tree and the currently open files will be the same as what wa...
I am writing some scripts that operate on emails in Maildir format. A lot of things are easy in this format, but the filenames are absolutely incomprehensible. For example, one script moves mails ...
You can try to break up the query into CTEs, and then see if any of the individual CTEs are unusually slow. I am guessing the query is not just one select, but probably has subqueries, window func...
Is it possible for a Python program to send itself in the background? For example, on Linux you can do nohup some_cmd & and any program will run in the background. Some programs also support s...
I know that 1 is sometimes called a pure function - although apparently a pure function must also not vary when the input is constant. By negation, the other kind are called impure functions, alth...
I don't think the question is trivial. Maven is very complex and confusing at first. The documentation is also quite something. It's not easy to figure out what's going on unless you already know. ...
This is in the docs. To paraphrase: Used for abstract methods that must be overridden in subclasses When the implementation is still WIP, but you want to leave a placeholder for the method name...
I handle this with: Create a new branch with same commits Delete commits from main branch In the situation shown, if you do git checkout -b new_branch it will create a new branch with the sa...
Normally gateways just do routing and maybe load balancing. That's one well-defined job that can be done well. You are adding a second job, which is to be a universal adapter. An adapter would be ...