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 |
---|---|---|---|---|
Edit | Post #289299 | Initial revision | — | almost 2 years 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) |
— | almost 2 years 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) |
— | almost 2 years ago |
Edit | Post #289278 |
Post edited: |
— | almost 2 years 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) |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: Avoid repeating the main examples within the details |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: fix formatting typo; improve wording a bit more |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: Consistently show errors from 3.11; improve section warnings |
— | almost 2 years ago |
Edit | Post #289251 |
Post edited: fix error message as shown in contemporary versions; add note about how it looks in older versions |
— | almost 2 years ago |
Edit | Post #289251 |
Post edited: edit example to match the changes in my answer (to shorten it and avoid line-wraps) |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: fix wording (the Template example requires instantiating a library class, so not a one-liner) |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: Oops, that wasn't quite short enough |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: Shorten the main example to avoid ugly wrapping on summary headers |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: Add warnings/advice to the top based on my old Stack Overflow answer https://stackoverflow.com/a/73658493; hide details for each approach with a direct code example; fix references `spam_cans` -> `count` in examples |
— | almost 2 years ago |
Edit | Post #289278 |
Post edited: |
— | almost 2 years ago |
Edit | Post #289278 | Initial revision | — | almost 2 years ago |
Answer | — |
A: Do we want a wiki (or similar) alongside Q&A? I think the framing of this question (and the prior discussion) is wrong, and I think that conditions have evolved since it was originally asked - in particular, we can now see how articles have turned out for other communities. Rather than try to define "wiki" or consider ways to implement that stra... (more) |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: Add inline-code formatting for details-section labels (refer: https://meta.codidact.com/posts/289271) |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: Fix header for %-style formatting, including relevant doc link |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: Even more detail, reorganization and polishing |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: Rearrange some points to exploit the labelled-example format more consistently |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: update and enhance information about f-string syntax limitations |
— | almost 2 years ago |
Comment | Post #289251 |
Regarding research and "readily accessible" information, please see [this meta question](https://software.codidact.com/posts/284979), where I put quite a bit of effort into explaining my own stance, as well as [my thoughts on how to grow the community](https://software.codidact.com/posts/285035/28917... (more) |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: tweak some wording to try to limit section headers to one line |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: More consistent formatting: establishing a style for the use of shaded <section>s |
— | almost 2 years ago |
Comment | Post #289255 |
Quick update: the new Q&A is [now live](https://software.codidact.com/posts/289264). (more) |
— | almost 2 years ago |
Edit | Post #289265 |
Post edited: |
— | almost 2 years ago |
Edit | Post #289265 | Initial revision | — | almost 2 years ago |
Answer | — |
A: How can I output / display multiple values, with controlled spacing, without building a string? Using the `write` method The `write` method of a file offers a much more limited interface. It only accepts one argument - a string, for a file opened in text mode - and outputs just what it's given. Any additional desired spacing must be specified explicitly. Sometimes, this makes it practical... (more) |
— | almost 2 years ago |
Edit | Post #289264 | Initial revision | — | almost 2 years ago |
Question | — |
How can I output / display multiple values, with controlled spacing, without building a string? I know that I can display a single string in the terminal window like `print("example")` (or similarly with a string in a variable), and I know how to open text files and write to them. I also know that I can create a "formatted" string, that contains multiple pieces of information, in a variety o... (more) |
— | almost 2 years ago |
Comment | Post #289170 |
When I'm answering questions about code nowadays, I tend to have way more prose than actual code. If there's a lot of code, it's because there are a lot of trivial examples that can't really be useful for others as-is. So I'm happy to stick with -BY license versions. Maybe this doesn't work for every... (more) |
— | almost 2 years ago |
Edit | Post #289252 |
Post edited: Whoops, totally forgot about string.Template the first time. |
— | almost 2 years ago |
Comment | Post #289255 |
In the (artificial) question here I intended specifically to distinguish the case of creating a new string (that could then be used within the program for other purposes). It's true that many people who need this kind of information are just trying to display something on screen; but I intended to po... (more) |
— | almost 2 years ago |
Edit | Post #289253 | Initial revision | — | almost 2 years ago |
Question | — |
On self-answered questions, is it inappropriate to mark my own answer "Works for me" immediately? Would it discourage others from posting answers, if they saw that a question had an answer with a "works for me" indication applied immediately? (More so than just seeing an immediate, comprehensive answer?) Could that ever be desirable? Or would it cause hurt feelings etc.? (more) |
— | almost 2 years ago |
Comment | Post #289170 |
In re "I wish the terms of the site could be changed, to make it specifically forbidden to use this data for model training without permission."
Adding this sort of restriction explicitly is not possible using Creative Commons licenses, and the necessary *legal* work to create modified versions is... (more) |
— | almost 2 years ago |
Edit | Post #289252 | Initial revision | — | almost 2 years ago |
Answer | — |
A: How can I build a string from smaller pieces? Before attempting this, make sure it makes sense in context. In a few particular situations, it would be better to take a different approach rather than using the normal tools for composing or formatting a string. If the string is for an SQL query, use the SQL library's built-in functional... (more) |
— | almost 2 years ago |
Edit | Post #289251 | Initial revision | — | almost 2 years ago |
Question | — |
How can I build a string from smaller pieces? Suppose I have some variables like: ```python >>> count = 8 >>> status = 'off' ``` I want to combine them with some hard-coded text, to get a single string like `'I have 8 cans of Spam®; baked beans are off'`. Simply writing the values in sequence only works for literal strings: ```python... (more) |
— | almost 2 years ago |
Edit | Post #287932 |
Post edited: remove more noise and streamline prose; remove inaccurate terminology that doesn't help explain the situation |
— | almost 2 years ago |
Comment | Post #289228 |
... Although, as I read these answers, I feel more and more like the concept of a statement is something we usually understand intuitively, and which is much harder to explain than it initially appears. (Expressions still seem fairly straightforward, though.) (more) |
— | almost 2 years ago |
Comment | Post #289234 |
Since 3.8, the `:=` operator in Python allows for assignments that *are* expressions, with some limitations. It seems worth mentioning in that section. (more) |
— | almost 2 years ago |
Comment | Post #289121 |
On Stack Exchange, Stack Overflow is around 15 times the size of anything else, and existed well before the Stack Exchange network came into existence. Codidact, on the other hand, started fresh with every proposed community on equal footing - rather than having a generalist site created as an aftert... (more) |
— | almost 2 years ago |
Comment | Post #289228 |
Of course I am able to answer this question myself; but I have several other self-answered questions in the works, and I want to help set the tone for missing, important reference questions like I have been talking about a bit in Meta. I expect that having this (and similar efforts) as a high quality... (more) |
— | almost 2 years ago |
Edit | Post #289228 | Initial revision | — | almost 2 years ago |
Question | — |
What are statements and expressions? When I have tried to read technical explanations of the syntax rules for programming languages, and when I am trying to decipher error messages, I often encounter the terms expression and statement. It comes across that these two are related to each other somehow. I understand that these terms hav... (more) |
— | almost 2 years ago |