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 Karl Knechtelâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Answer | — |
A: Are questions about (abstract) algorithms and datastructures considered on-topic? As the author, this is my defense. Design and modeling are on-topic The site topicality documentation explicitly includes "Software design, architecture, or modeling" as on topic. There doesn't seem to have been any objection in the original feedback process. I formulated the question with t... (more) |
— | over 1 year ago |
Comment | Post #289251 |
It seems appropriate to show common non-working attempts, because that will help someone who is redirected here after trying one of them. I'll try to simplify the wording, and move the point about versions to a footnote. (more) |
— | over 1 year ago |
Comment | Post #289691 |
The [site topicality guidelines](https://software.codidact.com/help/on-topic) explicitly permit Q&A about "Software design, architecture, or modeling", which I think this is. (more) |
— | over 1 year ago |
Comment | Post #289692 |
Of course, that will get into language-dependent details. The languages that *do* support large integers tend to represent booleans as separate objects and not necessarily have a bit-vector abstraction, so that can incur a lot of overhead again. But the main idea here is the representation of "subset... (more) |
— | over 1 year ago |
Edit | Post #289692 | Initial revision | — | over 1 year ago |
Answer | — |
A: Optimized representation for sets? First store the universe of potential elements as a sequence, then encode each set as an unsigned integer interpreted as follows: if the 1s bit in binary is set (1), the set contains the 0th element in the universe sequence; if the 2s bit is set, the set contains the 1st element; if the 4s bit, the 2... (more) |
— | over 1 year ago |
Edit | Post #289691 | Initial revision | — | over 1 year ago |
Question | — |
Optimized representation for sets? I need to do a lot of calculations involving sets. There are relatively few values in the "universe" of candidates that could appear in any of the sets, but potentially very many such sets (they might not initially be distinct, either). My language has a built-in (or standard library) representati... (more) |
— | over 1 year ago |
Comment | Post #289605 |
Do you need to be able to interrupt individual calls to `do_big_task`? Or only check in between each call, whether there has been a keypress since the previous call? (more) |
— | over 1 year ago |
Edit | Post #289599 |
Post edited: |
— | over 1 year ago |
Edit | Post #289599 | Initial revision | — | over 1 year ago |
Question | — |
What categories could we benefit from having? So far, existing Meta discussion seems to have at least hinted at the possibility of using separate categories here: To shuffle closed questions out of the way (globally for Codidact) (also) For debugging help requests (discussed in passing) (also) To recommend books or other resources To p... (more) |
— | over 1 year ago |
Edit | Post #289598 |
Post edited: HTML hack to avoid bogus links |
— | over 1 year ago |
Edit | Post #289598 | Initial revision | — | over 1 year ago |
Answer | — |
A: Should asking about book recommendations directly connected to software development be on-topic? Are books special? When I see a question like this, I naturally transform it into a more general question about resources. Printed books aren't necessarily the best way to learn about programming concepts; web pages may work much better. Some people like video tutorials; I personally have found th... (more) |
— | over 1 year ago |
Edit | Post #289597 |
Post edited: |
— | over 1 year ago |
Edit | Post #289597 | Initial revision | — | over 1 year ago |
Question | — |
Should self-answered Q&A use separate answers for different techniques/approaches (even if there's a caveat that applies overall)? Looking back at my own Q&A How can I build a string from smaller pieces?, the answer is incredibly long. I'm essentially showing five different ways to solve the problem - because they all exist, and well-informed developers should know about all of them. Would it make more sense to split the cont... (more) |
— | over 1 year ago |
Comment | Post #289584 |
"Would this be correct?" - Generally I don't think that this sort of thing forms the basis of a useful question for a Q&A site. Did you **try** the code? Does it give the results you expect? Does anything strange happen? It would be better to identify a concrete problem, if any, to ask about; otherwi... (more) |
— | over 1 year ago |
Comment | Post #289575 |
While generally I agree that *whereas pipx answers the question "As a user, how can I conveniently install a tool which is available via PyPi, without learning anything about Python* is an accurate summary of the intended use case - Pipx has the issue that it expects you to have Python and Pip alread... (more) |
— | over 1 year ago |
Comment | Post #289573 |
OP seems to have clearly intended that the Python program should exit after scheduling the next task, but this is a useful technique for other situations. Actually, I was hoping to prepare a more general Q&A for language-agnostic techniques for this kind of scheduling. (more) |
— | over 1 year ago |
Comment | Post #289514 |
I agree wholeheartedly, so I edited that in - even though it's unnecessary for the example as you say. After all, I could *also* have just written the separate list elements explicitly; but the point is to show a more general technique. (more) |
— | over 1 year ago |
Edit | Post #289514 |
Post edited: use shlex.split per trichoplax's suggestion |
— | over 1 year ago |
Comment | Post #289563 |
I see that you address the following to some extent in the "Encoding" section of the answer, but I think it could use some elaboration.
My understanding is that Posix indeed allows filenames to contain arbitrary byte sequences aside from the 0x00 NUL byte and the path separator (0x2f byte). It's a... (more) |
— | over 1 year ago |
Edit | Post #289568 | Initial revision | — | over 1 year ago |
Answer | — |
A: How should I organize material about text encoding in Python into questions? Here is my current thinking on the matter. 1. Regarding questions/facets that are "two sides of the same coin" - encoding vs decoding the data, reading vs. writing files - I think they should be addressed in one breath. 1. Regarding the Python documentation: I think it is better cited, on deman... (more) |
— | over 1 year ago |
Edit | Post #289559 | Initial revision | — | over 1 year ago |
Question | — |
How should I organize material about text encoding in Python into questions? I want to write one or more self-answered Q&As on the topic of text encoding in Python, to serve as canonicals and preempt future lower-quality questions. I can think of the following things that need to be addressed: What is an encoding? What are encoding (the process) and decoding? How do I k... (more) |
— | over 1 year ago |
Comment | Post #289514 |
I don't know anything about `systemd-run`, actually. My first thought was `cron`, but that's intended for regularly re-occurring tasks. When I tried to do research on that, `at` came up. (more) |
— | over 1 year ago |
Edit | Post #289514 |
Post edited: |
— | over 1 year ago |
Edit | Post #289514 | Initial revision | — | over 1 year ago |
Answer | — |
A: How can I schedule a later task in Python? Use `at` to schedule the command, using `subprocess` from Python to invoke `at`. It doesn't even require `shell=True`. For example: ``` import shlex, subprocess subprocess.run( # `at` command to run now shlex.split("at now +10 minutes"), # shell command that `at` will schedule, ... (more) |
— | over 1 year ago |
Comment | Post #289488 |
It's hard to address the part where you "also heard that its 2-argument function signature is flawed" because we do not know **where** you heard it, and therefore we cannot possibly know *what argument* was being presented. This doesn't add anything to the post as it stands; if there *is* a flaw, the... (more) |
— | over 1 year ago |
Edit | Post #289481 |
Post edited: mention specific point when the error-message improvement was added |
— | over 1 year ago |
Edit | Post #289481 |
Post edited: |
— | over 1 year ago |
Edit | Post #289481 | Initial revision | — | over 1 year ago |
Answer | — |
A: How can I properly type-hint methods in different files that would lead to circular imports? Import modules rather than names first to avoid a circular reference in the `import` statements; then use forward declarations, as before, to avoid a circular reference in the type annotations - like so: ``` process.py import helpers class Process: def dosomething(self, helper: "helper... (more) |
— | over 1 year ago |
Edit | Post #289386 |
Post edited: remove noise, fix formatting, add link for lesser-known third-party library, improve grammar |
— | over 1 year ago |
Comment | Post #289386 |
I couldn't understand the explanation of what you tried. For example "assign_coords is not an inplace operation" doesn't say what to try, it only describes a problem. If that was the title of a post on Stack Overflow, it's not useful to just show that; we should have the links as well. Aside from tha... (more) |
— | over 1 year ago |
Suggested Edit | Post #289386 |
Suggested edit: remove noise, fix formatting, add link for lesser-known third-party library, improve grammar (more) |
helpful | over 1 year ago |
Edit | Post #289346 |
Post edited: improve title: fix grammar, indicate the specific context |
— | over 1 year ago |
Suggested Edit | Post #289346 |
Suggested edit: improve title: fix grammar, indicate the specific context (more) |
helpful | over 1 year ago |
Comment | Post #289289 |
If the way it works inconveniences you, it shouldn't be hard to make a simple wrapper - checkout a target branch, run a normal merge command, then checkout the original branch again. [Since 2.22, the current branch name can be found with `git branch --show-current`](https://stackoverflow.com/question... (more) |
— | over 1 year ago |
Edit | Post #289299 | Initial revision | — | over 1 year ago |
Answer | — |
A: Why is git merge from rather than to? > I struggle to think of any use cases for merging from. Why was the merge command designed this way? The model here is that many developers on the same project are using branches to develop features independently; someone has to be in charge, and that is the person responsible for the `master` (r... (more) |
— | over 1 year ago |
Comment | Post #289275 |
It seems like you're looking for something that happens *after* `onbeforeunload`, not before. Wouldn't that just be... `onunload`? (more) |
— | over 1 year ago |
Edit | Post #289278 |
Post edited: |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: organize chronologically; add references for when features were added; label sections with brief guidance (and edit details to avoid repetition) |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: Avoid repeating the main examples within the details |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: fix formatting typo; improve wording a bit more |
— | over 1 year ago |