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
You can use existsSync: import { existsSync } from 'node:fs'; if (existsSync('/path/to/file')) { console.log('Found'); } else { console.log('Not found'); } If you want to avoid block...
How do I trim a sorted list in Python, so that I only keep the elements greater than a certain value? For example, if I have this list: l = [1, 3, 5, 6, 7, 8] How can I efficiently get a list of...
"Black box testing" makes sense when dealing with opaque types so that's the first thing you should be doing and probably the most meaningful test too, so that's where you should put most of yo...
To start with, it's worth noting that the Zen of Python is more about development of Python, rather than development with Python. That may mean that some bits of its wisdom are more applicable to q...
At this point in my learning journey, I simply accepted that this function is called pure (both in Haskell and in PureScript), but it would have helped a lot if I had known the reasoning behind thi...
Several times now, I've seen advice in tutorials, setup/install instructions for Python-based projects, etc. to use a virtual environment to keep things organized and make it simpler to manage the ...
I have multiple installations of Python on my machine. When I run Python, what determines which installation is used? How can I control this?
General This question and answer are adapted from my original write-up on Stack Overflow, which you may consult for more details. This version is crafted as to be a clear overview, without referri...
Contrary to popular belief, Pip is not part of the Python standard library - although it comes as part of a standard distribution of Python. Pip is developed and maintained by the arms-length Pytho...
I have already learned how to tell the Python interpreter to run my code, but the standard approach feels a little unsatisfactory. I want the user experience to be that my program starts with the a...
This answer assumes only installations of the reference "CPython" implementation, as provided by the official website at https://www.python.org. Other installations - such as those provided by th...
A direct answer to your question of where the name comes from is the paper that introduced Applicative functors, Applicative programming with effects (PDF). Quoting from there: The idea is that ...
In setting android:configChanges in AndroidManifest.xml, what is the difference between colorMode and uiMode? I hear uiMode is for changes between light/dark modes, which sounds exactly what colorM...
"Invariant" isn't really the right word to search, though that's clearly not obvious. The idea is that we have covariant functors where if we have a -> b we can make f a -> f b, and contravar...
Having looked up how Snappy compression works, I'm going to upgrade my comment to an answer as I'm almost certain this is what's happening. Based on the Firefox source code, it inserts LSValues wh...
In zsh, I want to create a function that updates RPROMPT when I have typed cd .. into the terminal. As a starting point, I know I can, for example, add the + character to my RBUFFER when I have typ...
Different tag sets per category It is important to be aware that the Q&A category and the Meta category have distinct sets of tags. This question is about the Meta tags only, which cannot be u...
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 run a small website and Im considering blocking proxies and vpns with ipquery to cut back on spam. I keep having bots autofill the contact us even though im using recaptcha. Does anyone have any ...
Some Codidact communities have MathJax enabled, which allows using mathematical notation in posts. For examples of what this looks like, see the end of the Mathematics Codidact formatting help. Wo...
I'm working with GitLab CI. The pipelines I'm designing contain several jobs that, once executed successfully, there shouldn't be any reason to retry/rerun them. This is an example: default: # ...
Starting up Python There are several key ways to use the python command from the command line: python by itself starts a REPL that allows typing in and running Python code on the fly, one sta...
Here in Python, I created a program for this challenge and I'm having trouble debugging it. I already fixed most errors I have on my program but here's what I have left: x=y=z=[];i=0.0;a=int(input...
I'm using Python to invoke another program in a sub-process. I've noticed my memory sometimes gets so large as to crash the system, and I'm wondering if I'm not correctly cleaning up the memory som...
I'm trying to log error messages from Requests exceptions. Example: try: make_web_request() except RequestException as ex: logging.error(ex) Example output: ERROR : ('Connection abo...