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 |
---|---|---|---|---|
Comment | Post #291132 |
Well, I think that we accept *library and tool* recommendations, but not recommendations for software that would be targeted at end users. :) There has been a fair amount of discussion on Stack Overflow meta recently about whether people are being too strict or pedantic in excluding those sorts of qu... (more) |
— | about 1 year ago |
Comment | Post #291125 |
Even if you are not confident in your findings below the line, they certainly come across as a sincere attempt to answer the question above the line. It should be posted as an answer instead. This is a [perfectly acceptable and encouraged](https://meta.codidact.com/posts/290638) use of the site softw... (more) |
— | about 1 year ago |
Comment | Post #291068 |
> if this place is intended to be basically a wiki but in QA format, I think a lot of help/onboarding parts need a big rewrite.
You're absolutely right to be concerned, IMO. This is exactly the sort of issue that Codidact sought to address, and found fault with in SO, back at the time. However, I ... (more) |
— | about 1 year ago |
Comment | Post #291068 |
I'm inclined to agree. Just as we don't treat the OP as special with regard to "accepting" answers (a "worked for" reaction can be applied by anyone), I would prefer that the original author of a question (or answer!) is credited in proportion to the work (both quantity and quality) done on that post... (more) |
— | about 1 year ago |
Comment | Post #291089 |
> So the question is really what to do with those naive newbies. Let them be naive, and work around them? Or have them go away and come back when they get it? I mean obviously you're saying the second, I'm saying the first, but the site collectively has to settle on one and make it clear.
Ideally,... (more) |
— | about 1 year ago |
Comment | Post #291132 |
A question like this necessarily solicits either speculation or personal experience, in a way that was already found on Stack Overflow not to work well. I strongly feel that this is not something particular to Stack Overflow culture, but a consequence of the true nature of a technical Q&A site. The p... (more) |
— | about 1 year ago |
Comment | Post #291112 |
I'm afraid I don't follow. With `strcpy` or `memcpy`, it's still necessary to verify that the buffer has enough room, and it comes across to me that this is not any less work or harder to overlook.
I'm familiar with your previous Q&A and I have to admit I didn't find it very convincing. That said,... (more) |
— | about 1 year ago |
Comment | Post #291068 |
I agree that experts [should be proactively asking](https://meta.stackoverflow.com/questions/426205/) questions that are of interest to beginners (and as I already pointed out, you've had the same idea on Linux Systems).
Regarding re-asking poorly asked questions, I think you should ask a separate... (more) |
— | about 1 year ago |
Comment | Post #291089 |
Regarding workable standardized reasons to close a question, I agree that the breakdown on Stack Overflow is somewhat awkward. I've written about other possibilities on our Meta before (it may have been the overall Meta), but it won't be easy for me to find at the moment. (more) |
— | about 1 year ago |
Comment | Post #291089 |
Abuse and misunderstanding (and everything in between) of close reasons is always a concern, regardless of what the stated reasons are. But in all seriousness, a very large fraction of questions that trigger the "stupid question" emotional response *really are* overly broad, and that broadness is ver... (more) |
— | about 1 year ago |
Comment | Post #291089 |
To understand "you don't get an answer, written for you, directly to your question" as punitive, one must first presume that the opposite is a privilege. But that's simply not how a Q&A site works. In fact, "your question" already betrays a misunderstanding - that's why there is content licensing. Th... (more) |
— | about 1 year ago |
Edit | Post #291111 |
Post edited: |
— | about 1 year ago |
Edit | Post #291112 | Initial revision | — | about 1 year ago |
Answer | — |
A: How can I manage multiple consecutive strings in a buffer (and add more later)? The fundamental problem here is that it is already ambiguous where the "end" of the data in the buffer is. Strings can be empty (have zero length as reported by `strlen`); as such, `buffer` could equally well be interpreted as containing three strings, where the last is empty. Or more than that - up ... (more) |
— | about 1 year ago |
Edit | Post #291111 | Initial revision | — | about 1 year ago |
Question | — |
How can I manage multiple consecutive strings in a buffer (and add more later)? This question is inspired by If I have a char array containing strings with a null byte (\0) terminating each string, how would I add another string onto the end? on Stack Overflow. Suppose I have a `char[]` buffer that I'm using to represent multiple null-terminated (ASCII) strings, one after the... (more) |
— | about 1 year ago |
Edit | Post #291034 |
Post edited: improve tagging |
— | about 1 year ago |
Suggested Edit | Post #291034 |
Suggested edit: improve tagging (more) |
helpful | about 1 year ago |
Comment | Post #291068 |
Regarding the overhead of reopening closed questions, I think that merits a separate discussion on the network-wide Meta to come up with ideas for streamlining.
Regarding expertise: as someone with a reasonable claim to "expertise" in Python, I would much rather feel responsible for *asking the qu... (more) |
— | about 1 year ago |
Edit | Post #291089 | Initial revision | — | about 1 year ago |
Answer | — |
A: Don't close questions for lack of detail/confusion No. Terms like "too generic", "unclear", "too broad", "off topic" are absolutely not euphemisms for "stupid question, go away". They mean what they say; and when they are used Somewhere Else, multiple of them exist simultaneously for a reason. They are explicitly not designed to be used to judge t... (more) |
— | about 1 year ago |
Comment | Post #291046 |
Specifically: what I understood from the question so far is that you have solved the problem of making a list of strings from the input file, and now you are trying to group them. The fact that you have something else to do with those groups (compute a Cartesian product) is irrelevant (if you have di... (more) |
— | about 1 year ago |
Comment | Post #291046 |
A Q&A site isn't the right place to get code debugged. Questions are supposed to be of use to future visitors, too. To make this question appropriate, you should first decide: is this about how to solve the grouping problem, or is it about fixing the problem in the code?
If you specifically want ... (more) |
— | about 1 year ago |
Comment | Post #290905 |
Is the question supposed to be about correctness, or style? If it's about correctness, did you *try* each way? Or if you're trying to offer a self-answered canonical, do you have a *reason to expect* that people would get it wrong? If it's about style, then what criteria do you consider relevant to ... (more) |
— | about 1 year ago |
Comment | Post #290682 |
That seems completely unrelated to me. Controlling where the file ends up when it's packaged (so that the existing code properly refers to its path) is a completely separate problem from actually specifying the path in the code. It should be addressed by a separate Q&A. I can imagine that question li... (more) |
— | about 1 year ago |
Edit | Post #287312 |
Post edited: Avoid unnecessarily heavy formatting; copyedit for improved flow and clarity |
— | about 1 year ago |
Edit | Post #290682 | Initial revision | — | about 1 year ago |
Answer | — |
A: Open file in script's own folder Theory Relative paths are relative to the current working directory of the Python process. This can be checked from within Python using the `os.getcwd` function and set using the `os.chdir` function. Whenever Python loads a module, a `file` attribute may be set on the resulting module object, g... (more) |
— | about 1 year ago |
Suggested Edit | Post #287312 |
Suggested edit: Avoid unnecessarily heavy formatting; copyedit for improved flow and clarity (more) |
helpful | about 1 year ago |
Edit | Post #290681 | Initial revision | — | about 1 year ago |
Answer | — |
A: How can I provide additional information when raising an exception? The `raise` statement in Python accepts either an Exception class or an instance of that class. When used with a class, Python will create and raise an instance by passing no arguments to the constructor. Python exception constructors, by default, accept an arbitrary number of positional arguments... (more) |
— | about 1 year ago |
Comment | Post #278277 |
On Software for example, it seems appropriate that a question motivated by a typo or other similar, simple oversight - provided that the Q&A wouldn't be useful to others, i.e., it doesn't represent a mistake that *someone else* could have realistically made in earnest - should be closed. Presumably, ... (more) |
— | about 1 year ago |
Comment | Post #286185 |
The rest of what you say makes sense from a pragmatic software engineering perspective; but I struggle with the idea that this might have actually been meant as an exercise in recursion. Sure, the stack-based approach could be adapted to use the call stack implicitly, but that doesn't seem like a goo... (more) |
— | over 1 year ago |
Edit | Post #290580 | Initial revision | — | over 1 year ago |
Answer | — |
A: Detecting balanced parentheses in Python Command-line timing Rather than using separate code for timing, I tried running the `timeit` module as a command-line tool. I wrote initial versions of the implementations based on the OP and hkotsubo's answer, as a file `balance.py`: `balance.py` ``` def usingreplace(s): if len(... (more) |
— | over 1 year ago |
Edit | Post #290579 | Initial revision | — | over 1 year ago |
Answer | — |
A: JSON log formatter PEP 8 Four-space indentation is the community standard. There are many strategies for wrapping long lines; I have found that it's often best to just use temporary variables to avoid wrapping lines. Avoid pointless classes The `UncaughtExceptionHook` class is a textbook example of the design ... (more) |
— | over 1 year ago |
Edit | Post #290551 |
Post edited: Fixed a few typos |
— | over 1 year ago |
Edit | Post #290575 |
Post edited: misc copyediting/typo fixes, and nicer formatting |
— | over 1 year ago |
Suggested Edit | Post #290551 |
Suggested edit: Fixed a few typos (more) |
helpful | over 1 year ago |
Edit | Post #290575 | Initial revision | — | over 1 year ago |
Answer | — |
A: How to troubleshoot ModuleNotFoundError? Root cause `ModuleNotFoundError` is a kind of `ImportError`. It occurs when Python code tries to use an absolute import, but can't find the named module - just as the name suggests. (Failed relative imports will only raise the base `ImportError`. This makes sense because an absolute import involve... (more) |
— | over 1 year ago |
Comment | Post #289252 |
I think that's out of scope for this question. The purpose isn't to showcase string formatting, but rather string *assembly*. I did touch on format specifiers, but deep within the nested details tags, and even then saying to read the documentation to understand it properly. (more) |
— | over 1 year ago |
Edit | Post #290342 |
Post edited: Edit tags; PEP20 was written in the 2.x days and nothing about its advice is version-specific. |
— | over 1 year ago |
Suggested Edit | Post #290342 |
Suggested edit: Edit tags; PEP20 was written in the 2.x days and nothing about its advice is version-specific. (more) |
helpful | over 1 year ago |
Comment | Post #290343 |
I appreciate the feedback, and agree that certain topics can be split off - I'll think about it in more detail. I don't require answers for them; while you're of course always welcome in the Codidact model to add your own answers, the point here is very explicitly for me to share knowledge that I alr... (more) |
— | over 1 year ago |
Edit | Post #290337 | Initial revision | — | over 1 year ago |
Question | — |
What does "namespace" mean? A well-known easter egg in Python displays some ideas about writing good Python code, credited to Tim Peters (one of the core developers). This question is about the last: > Namespaces are one honking great idea -- let's do more of those! It seems that the concept of a "namespace" appears in pr... (more) |
— | over 1 year ago |
Edit | Post #289756 |
Post edited: Clarify the status of PEP 671, and do some copyediting |
— | over 1 year ago |
Edit | Post #290057 |
Post edited: Update link to refer to new canonical I wrote for the syntax in question |
— | over 1 year ago |