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
Files with .py extension are scripts. You run them with python myscript.py. Python is an imperative language, so executing a file will run each line one by one, starting from the top, and exit whe...
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 ==== ...
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...
For future readers - based on input from Michael, and some research that was spurred by that improved version, this is the final config I arrived at: # https://gnutls.org/manual/html_node/certtool...
A global variable or object is in scope everywhere. That means it's possible to modify it from any part of your program. Imagine a mature program, made up of thousands of lines of code and dozens ...
Nothing in particular will go wrong. global is a valid and supported keyword, the code will work. There is no problem for the computer. The problem is for you. When something is global, it could b...
Many languages discourage global variables. Why is this?
I don't actually know the answer to this, but I'll post a provisional one while we wait for someone wiser than me to chime in. I think this is a small subset of the real answer. Don't forget the...
Suppose someone has the requisite knowledge and skillset to contribute to a FOSS project, they have the free time to do so and they are aware of the project. Yet, they decide not to contribute. Thi...
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...
The obvious way would be to simply start with an empty list of lists, loop through the input, and for each item decide which sublist to put it in. It's not super dev-friendly to remember which lis...
Is software system design on topic for the software development site? For what I mean by system design, consider the "system design interview" commonly held these days when recruiting software eng...
tl;dr: When a question is unclear, don't close right away, especially if it's possible to discern what they are trying to ask. Instead, use comments and edit suggestions to work with the asker and ...
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...
You could just move the files to a new folder and open that :) Alright alright here's a serious answer: I noticed that VSC automatically dereferences symlinks. So if you create a temporary new fol...
Hashing is lossy compression. You can't recover the input of a hash from the result. This would obviously not work as an encryption. How would you decrypt it, if half the message is destroyed :) ...
This is not feasible as described. To learn LLMs, you can look at models like 3B WizardLM. These are open source and should be possible to just train and run as is. The build may be very complex, ...
ModuleNotFoundError means that in running your program, Python attempted to import some module xyz but it was not present on your system. It could be that you forgot to install the module (forgot ...
I ran some Python code and it crashed with ModuleNotFoundError. What is the general approach for dealing with these situations?
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...
The Python ternary "operator" is if and else: x = 1 if some_condition else 0 In Python, this is called a "conditional expression" rather than an operator, and the documentation explains it: htt...
Everything you put on the line with def is global (global to the file, not as in the global keyword), so the (initially empty) list you create with param=[] persists and gets reused between calls t...
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...
The reason this practice exists is because CIs suck. The frameworks/services themselves suck, and the way people write the configs also suck, and the two combine to create a mega-suck. A CI is sup...
Suppose you have a jinja template like this: I am going to {{ foo }} to get some {{ bar }}. I hope I can find: {% for i in baz %} - {{i}} {% endfor %} This template will require you to pass ...