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 #289252 |
Post edited: tweak some wording to try to limit section headers to one line |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: More consistent formatting: establishing a style for the use of shaded <section>s |
— | over 1 year ago |
Comment | Post #289255 |
Quick update: the new Q&A is [now live](https://software.codidact.com/posts/289264). (more) |
— | over 1 year ago |
Edit | Post #289265 |
Post edited: |
— | over 1 year ago |
Edit | Post #289265 | Initial revision | — | over 1 year 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) |
— | over 1 year ago |
Edit | Post #289264 | Initial revision | — | over 1 year 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) |
— | over 1 year 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) |
— | over 1 year ago |
Edit | Post #289252 |
Post edited: Whoops, totally forgot about string.Template the first time. |
— | over 1 year 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) |
— | over 1 year ago |
Edit | Post #289253 | Initial revision | — | over 1 year 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) |
— | over 1 year 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) |
— | over 1 year ago |
Edit | Post #289252 | Initial revision | — | over 1 year 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) |
— | over 1 year ago |
Edit | Post #289251 | Initial revision | — | over 1 year 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) |
— | over 1 year ago |
Edit | Post #287932 |
Post edited: remove more noise and streamline prose; remove inaccurate terminology that doesn't help explain the situation |
— | over 1 year 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) |
— | over 1 year 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) |
— | over 1 year 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) |
— | over 1 year 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) |
— | over 1 year ago |
Edit | Post #289228 | Initial revision | — | over 1 year 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) |
— | over 1 year ago |
Suggested Edit | Post #287932 |
Suggested edit: remove more noise and streamline prose; remove inaccurate terminology that doesn't help explain the situation (more) |
helpful | over 1 year ago |
Edit | Post #289213 | Initial revision | — | over 1 year ago |
Answer | — |
A: How to compress columns of dataframe by function Conceptually, applying a function along an axis of a `DataFrame` (i.e., applying it to each row or column) inherently produces a `Series`: a two-dimensional result is collapsed to a one-dimensional result, because one-dimensional "lines" of data are fed into a function that produces a scalar value. ... (more) |
— | over 1 year ago |
Comment | Post #285035 |
FWIW, @#8176, the self-answered question you mention in the other thread is a perfect example of what I advocate for in my answer here. Let's do more of that. A lot more. (more) |
— | over 1 year ago |
Edit | Post #289212 | Initial revision | — | over 1 year ago |
Answer | — |
A: Questions easily answered by studying a beginner-level book There's still time > This scenario is not yet a problem for this site, but we will get there, since it's a huge problem for Stack Overflow This topic should be separately addressed, too. At time of writing, the main category here has 673 posts (perhaps a few more deleted ones, because I coul... (more) |
— | over 1 year ago |
Edit | Post #289189 |
Post edited: |
— | over 1 year ago |
Edit | Post #289189 |
Post edited: add another option |
— | over 1 year ago |
Edit | Post #289189 | Initial revision | — | over 1 year ago |
Answer | — |
A: Automatically install all packages needed A compromise exists between automatically inferring package names (unreliable and potentially dangerous) and writing out an explicit separate `requirements.txt` file: script-running tools such as `pip-run` may offer the ability to parse requirements declared explicitly within the source file itself, ... (more) |
— | over 1 year ago |
Comment | Post #289043 |
While this idea seems good on the surface, I'm not confident that the SO community will be very happy about it. (more) |
— | over 1 year ago |
Comment | Post #285894 |
When other threads are already expanded and you click "start a new comment thread", you might have to scroll quite some distance to the actual comment submission form. There's a good chance it isn't even on screen at that point, meaning you don't get immediate visual confirmation. The form should app... (more) |
— | over 1 year ago |
Comment | Post #285067 |
Is this still happening for you now, BTW? Or has this answer become outdated? (more) |
— | over 1 year ago |
Edit | Post #289176 | Initial revision | — | over 1 year ago |
Answer | — |
A: How can we grow this community? Never Too Late Due to, shall we say, recent AI-related hallucinations, pretty much everything that was possible PR-wise in 2019 is possible for this site again. People are leaving Stack Overflow and this is arguably the best existing alternative. Opportunity has knocked again, but in a sense it re... (more) |
— | over 1 year ago |