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.
Activity for matthewsnyderâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #289837 |
Post edited: |
— | 8 months ago |
Comment | Post #289828 |
Usually cables don't blow up from a short, especially if you're doing layman things. Shorts will allow electricity to be consumed rapidly. With grid AC (as in house wiring) there are already circuit breakers that will automatically turn off when current goes too high. With batteries, the battery will... (more) |
— | 8 months ago |
Edit | Post #289837 |
Post edited: |
— | 8 months ago |
Edit | Post #289837 | Initial revision | — | 8 months ago |
Answer | — |
A: What is the meaning of "short circuit" operators? It means the program can give up early if checking the rest of a boolean expression is pointless. For example, naively to evaluate `p and q` you must check the value of both `p` and `q`, and then do the `and` operation. However, if you are a bit more clever, you'll see that when `p` is `False`,... (more) |
— | 8 months ago |
Edit | Post #289804 | Initial revision | — | 8 months ago |
Answer | — |
A: How should open source forks, with a mix of upstreamable and non-upstreamable commits, be maintained? The ideal way is to separate the upstreamable and non-upstreamable changes. For example you could maintain two branches: `public` and `private`. All upstreamable changes are cherry picked to public and this is what you send back to the upstream. All your non-upstreamable changes would be in privat... (more) |
— | 8 months ago |
Edit | Post #289748 | Initial revision | — | 8 months ago |
Answer | — |
A: Alternatives to `EXPLAIN ANALYZE` for queries that won't complete 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 functions, aggregations, joins and so on. All of these can be split into CTEs pretty easily (if you have q... (more) |
— | 8 months ago |
Edit | Post #289725 | Initial revision | — | 8 months ago |
Question | — |
Is there a text version of pickle? Is there a Python serialization format that has capabilities similar to Pickle, but is text based? The problem I always have with pickle is that it's binary, so I can't manually view or edit the data. The standard library includes `json`, but that requires a tedious converting of types at read ... (more) |
— | 8 months ago |
Comment | Post #289633 |
While this makes sense, it seems a bit strange.
1) Isn't it bad to use exceptions for flow control?
2) Wouldn't this be surprising to a user who expects that `Ctrl+C` will *terminate* the program? (more) |
— | 8 months ago |
Edit | Post #289605 |
Post edited: |
— | 9 months ago |
Comment | Post #289605 |
No, just checking between calls is enough. (more) |
— | 9 months ago |
Edit | Post #289605 | Initial revision | — | 9 months ago |
Question | — |
Listen for key events in a CLI app I have a Python program like this: ```python done = False while u and not done: i = u.pop() print(f"Processing {i}") dobigtask(i) finishup() ``` Since this takes a long time, the user might get tired of waiting. I want the program to also continually listen for a keystroke, s... (more) |
— | 9 months ago |
Comment | Post #289588 |
Why don't you just try changing it and see if it runs slower? (more) |
— | 9 months ago |
Edit | Post #289589 |
Post edited: |
— | 9 months ago |
Edit | Post #289589 |
Post edited: |
— | 9 months ago |
Edit | Post #289589 |
Post edited: |
— | 9 months ago |
Edit | Post #289589 |
Post edited: |
— | 9 months ago |
Comment | Post #289589 |
The two previous questions explain the issue in more detail, but I'm adding my own summary in the hopes that it will be useful to other readers. (more) |
— | 9 months ago |
Edit | Post #289589 | Initial revision | — | 9 months ago |
Answer | — |
A: What is the point of pipx? Dependency conflicts are the problem pipx aims to solve, in the context of installing CLI programs. When you install a Python package, by default pip will also install their dependent packages so that you don't get `ImportError`s when trying to use the package. These dependencies are explicitly co... (more) |
— | 9 months ago |
Comment | Post #289575 |
Thank you! That actually does answer my question. (more) |
— | 9 months ago |
Comment | Post #289575 |
First, it's more accurate to say that `pip` is for installing python *packages*. When you say "dependencies", that makes it sound as if it can't install "tools", when in fact it can install any package. I am not aware of pip being specced specifically as to exclude installing non-dependencies. This i... (more) |
— | 9 months ago |
Edit | Post #289566 | Initial revision | — | 9 months ago |
Answer | — |
A: How should I organize material about text encoding in Python into questions? Much of this is already covered in various sources like https://docs.python.org/3/howto/unicode.html. Although there are issues with relying on links, I figure official documentation is probably fair game. I would start with two types of question: "Where can I find detailed information about t... (more) |
— | 9 months ago |
Comment | Post #289514 |
Didn't know about `at` - seems like what I was looking for. Is this better [than systemd-run](https://linux.codidact.com/posts/289510/289511#answer-289511)? (more) |
— | 9 months ago |
Edit | Post #289509 | Initial revision | — | 9 months ago |
Question | — |
How can a Python program send itself to the background? Is it possible for a Python program to send itself in the background? For example, on Linux you can do `nohup somecmd &` and any program will run in the background. Some programs also support switches like `-d` (daemonize) to run in the background without `nohup`/`&`. How can a Python program do t... (more) |
— | 9 months ago |
Edit | Post #289508 | Initial revision | — | 9 months ago |
Question | — |
How can I schedule a later task in Python? 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 is easier. I can convert my use case to accommodate it. This would be on Linux only. How can I sc... (more) |
— | 9 months ago |
Edit | Post #289484 |
Post edited: |
— | 9 months ago |
Edit | Post #289506 | Initial revision | — | 9 months ago |
Answer | — |
A: Clone .git repo into current dir, without touching files One way to do it is to simply clone the repo elsewhere and move the .git file to the current one. (more) |
— | 9 months ago |
Edit | Post #289505 | Initial revision | — | 9 months ago |
Question | — |
Clone .git repo into current dir, without touching files I have git repo where the .git is deleted. I didn't realize it until after I made some changes to the code. I want to re-create the `.git` by cloning. However I don't want it to touch the files that I already have. When the `.git` is cloned, I will run git checkout and it will detect my changes as... (more) |
— | 9 months ago |
Comment | Post #280700 |
This is a very transactional way to look at it. Taken to its logical conclusion, it implies there's no point contributing to open source at all.
I understand that some people choose to provide their work for free and resent the fact that they don't get more money out of it. Not all FOSS devs are l... (more) |
— | 9 months ago |
Edit | Post #289486 | Initial revision | — | 9 months ago |
Answer | — |
A: Git: How to clone only a few recent commits? This is called a shallow clone and it's supported by a git-clone argument: ``` git clone --depth 5 ``` (more) |
— | 9 months ago |
Edit | Post #289484 | Initial revision | — | 9 months ago |
Question | — |
Git: How to clone only a few recent commits? How do I clone the repository with only part of the history? For example, let's say I want to download only the last 5 commits out of thousands. (more) |
— | 9 months ago |
Edit | Post #289445 |
Post edited: |
— | 9 months ago |
Comment | Post #289443 |
I agree on that as well. "How pipx works" is interesting and useful, but it's not pertinent information. It should be in a separate post. (more) |
— | 9 months ago |
Comment | Post #289443 |
This has some information but it seems a bit too biased in favor of pipx. The first three paragraphs don't add anything. There's some speculation about features that are not actually part of pipx. In the bulleted list, IMO 3, 4 and 6 are already things you get in pip. That said, there are some reason... (more) |
— | 9 months ago |
Edit | Post #289445 | Initial revision | — | 9 months ago |
Answer | — |
A: Is it wrong to demand features in open-source projects? "Demanding features" falls under an umbrella called "design". Design work doesn't show up directly in the commits (unless you maintain a design doc) but it is work nonetheless. Suggesting features is volunteer design work. In principle, the maintainer should welcome such work just as they would w... (more) |
— | 9 months ago |
Comment | Post #289427 |
@#56342 But look what we get if we follow your logic: pip, pipx, apt, brew, cargo (and probably Julia, which I don't know) can all install packages in system locations. Then saying that "pipx is like apt or brew because it installs packages" makes no sense, because pip does that too. So why would you... (more) |
— | 9 months ago |
Comment | Post #289427 |
@#53177 I was thinking of `apt` and `brew`, not `Nuget`. This is because the linked page calls them out as examples. AFAIK `nuget` is basically the pip of C#, which is probably why pipx docs don't use it as an example.
Anyways, I was hoping that the question does not require you to guess what I un... (more) |
— | 9 months ago |