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 Dirk Herrmannâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #286185 |
Post edited: |
— | 10 months ago |
Comment | Post #286185 |
You are right, I wrote recursion, but in fact had the stack based approaches in mind. I changed my answer with respect to this point. (more) |
— | 10 months ago |
Comment | Post #288669 |
Hi Markus, I suggest to add this as a separate question. Then, more people will see it and can help you. I may not be able to look into it during the next days. (more) |
— | about 1 year ago |
Edit | Post #289263 |
Post edited: |
— | over 1 year ago |
Edit | Post #289263 |
Post edited: |
— | over 1 year ago |
Edit | Post #289263 |
Post edited: |
— | over 1 year ago |
Edit | Post #289263 | Initial revision | — | over 1 year ago |
Answer | — |
A: What are statements and expressions? The use of the terms expression and statement could vary between programming languages. However, the following distinction is widely used: Expressions are syntactic forms that allow software authors to describe computations. They intentionally only bring few constraints with respect to ordering.... (more) |
— | over 1 year ago |
Edit | Post #288941 |
Post edited: Added note about unit-testing static functions and limitations due to special development tools. |
— | over 1 year ago |
Edit | Post #288941 |
Post edited: |
— | over 1 year ago |
Edit | Post #288941 |
Post edited: |
— | over 1 year ago |
Edit | Post #288941 | Initial revision | — | over 1 year ago |
Answer | — |
A: What are disadvantages of static functions (ie functions with internal linkage) in C? There are some reasons why a function would intentionally not be declared `static`. (In the following I use the term 'module', but in contrast to others, I use it not to describe a file or translation unit, but rather for an architectural entity (for example, a library), which can consist of several... (more) |
— | over 1 year ago |
Comment | Post #288771 |
Thanks for the clarification - I understand that there are in fact two relations, one being the relation you mentioned: "pairs (a, b) and (x, y) are equal when either a = x or b = y" which is not an equivalence relation (and that was what my comment was pointing at), but which "generates" another rel... (more) |
— | over 1 year ago |
Comment | Post #288771 |
Assume the pairs (1,a), (2,a), (2,b), (3,b) are given. Wouldn't then {1,2,3} have to be in one set, and {a,b} as well? The pairs (1,a) and (3,b), however, do not fit the proposed equivalence relation. (more) |
— | over 1 year ago |
Edit | Post #288687 |
Post edited: |
— | over 1 year ago |
Edit | Post #288687 |
Post edited: |
— | over 1 year ago |
Edit | Post #288687 | Initial revision | — | over 1 year ago |
Answer | — |
A: For scripting what are the pros and cons of command line arguments versus capturing input at the start? I would like to add further options to the set of possibilities, namely environment variables and GUI input. Moreover, I would like to distinguish reading information from `stdin` and from other (named) files, as this has some architectural implication. With the options from the OP and other answ... (more) |
— | over 1 year ago |
Edit | Post #288669 | Initial revision | — | over 1 year ago |
Answer | — |
A: Count the number of occurrences in a text string @elgonzo mentioned correctly that the nice trick from @pnuts can not be applied if you are interested in the number of occurrences including overlapping ones. So, just in case someone is in need of such a functionality, here is a function in LibreOffice Basic which handles that case: ``` Funct... (more) |
— | over 1 year ago |
Edit | Post #288301 |
Post edited: Small fix, confused foo and bar at one place |
— | over 1 year ago |
Edit | Post #288301 |
Post edited: |
— | over 1 year ago |
Edit | Post #288301 |
Post edited: |
— | over 1 year ago |
Edit | Post #288301 |
Post edited: |
— | over 1 year ago |
Edit | Post #288301 |
Post edited: |
— | over 1 year ago |
Edit | Post #288301 |
Post edited: Improved find command, added discussion about finding foo and bar on the same line |
— | over 1 year ago |
Edit | Post #288301 |
Post edited: |
— | over 1 year ago |
Edit | Post #288301 | Initial revision | — | over 1 year ago |
Answer | — |
A: grep AND search for multiple words in files From your description ... > I have text (xml actually) files. Some files contain 'foo', some contain 'bar', some contain neither and some contain both. It's the both I'm interested in. ... I conclude that you are interested in files that contain both 'foo' and 'bar', but not necessarily on the... (more) |
— | over 1 year ago |
Edit | Post #288281 |
Post edited: |
— | over 1 year ago |
Edit | Post #288281 |
Post edited: |
— | over 1 year ago |
Edit | Post #288281 |
Post edited: |
— | over 1 year ago |
Edit | Post #288281 | Initial revision | — | over 1 year ago |
Answer | — |
A: What is the purpose of grouping the tests in a `tests` module and is it possible to split them? When you think about how to organize your test code, you should develop an understanding of your goals. Typical goals about test code organization (which typically includes helper code only needed for the tests) are: Ensure that test code does not become part of production code - for some kinds ... (more) |
— | over 1 year ago |
Edit | Post #288043 | Initial revision | — | over 1 year ago |
Answer | — |
A: Can freed pointers undergo lvalue conversion? I see it such that it is undefined behavior (I refer to N1570 as the OP https://port70.net/nsz/c/c11/n1570.html): After `free(p)`, the lifetime of the object pointed to has ended (7.22.3p1: "The lifetime of an allocated object extends from the allocation until the deallocation.") Consequently, ... (more) |
— | over 1 year ago |
Edit | Post #287938 | Initial revision | — | over 1 year ago |
Answer | — |
A: Should we allow answers generated by ChatGPT? The expectation for all posts is, that a post is always understood as the own work of the poster, who has the copyright and responsibility for it and offers it to the site according to the site's conditions regarding editing etc. What we should ban, therefore, is adding of verbatim ChatGPT respons... (more) |
— | over 1 year ago |
Edit | Post #287599 |
Post edited: |
— | almost 2 years ago |
Edit | Post #287599 | Initial revision | — | almost 2 years ago |
Answer | — |
A: How to proportionally convert a number in the range of -1 and 1 to a number in the range of 0 and 319 There is one thing to clarify when mapping a float interval to an integer interval, namely how the boundaries of the float interval shall be mapped to the boundaries of the integer interval. Taking the example of the float interval [-1.0, +1.0], assuming here, that the endpoints of the interval ca... (more) |
— | almost 2 years ago |
Comment | Post #287313 |
Sorry, I don't get it. Please provide one or better more examples of the inputs and the expected outputs. Moreover, also provide what you have tried yourself so far. Also, please try to be syntactically clean. Your listA is not a valid list, and thus it is not clear what you mean it to represent.... (more) |
— | about 2 years ago |
Edit | Post #287083 |
Post edited: |
— | about 2 years ago |
Edit | Post #287083 |
Post edited: |
— | about 2 years ago |
Edit | Post #287083 | Initial revision | — | about 2 years ago |
Answer | — |
A: C naming convention, module trigrams? Starting with the goals: A naming convention typically aims at supporting several, partly contradictory goals, among which are the following: Compliance with the limitations of the language standard and possibly other standards that apply. There are many symbols that are reserved by the ISO-C st... (more) |
— | about 2 years ago |
Edit | Post #287000 |
Post edited: Changed link formatting |
— | about 2 years ago |
Edit | Post #287000 |
Post edited: Added explanation about the background for the `register` storage class constraint. |
— | about 2 years ago |
Comment | Post #286974 |
This goes then in a different direction:
* From a pure C perspective, there is no issue with global variables being uninitialzed. Global variables are always initialized. If you don't given an explicit initializer, they are implicitly initialized to 0.
* In your case, you are dealing with glo... (more) |
— | about 2 years ago |