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 __blackjack__
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #288995 | Initial revision | — | over 1 year ago |
Answer | — |
A: Program freezing in `post_comments_to_lemmy` function due to potential infinite loop There is no infinite loop. If the dictionary is a string, it is simply skipped. If all dictionaries are strings, than all elements of the finite list are skipped, and the function returns without posting anything. So either the program hangs in the `postcommenttolemmy()` function, that we don't ... (more) |
— | over 1 year ago |
Comment | Post #288940 |
I'm a bit sceptical about the „old timers“ argument. `static` is an opportunity to hint the compiler that this function could be inlined. That's something you want on slower systems for very small functions and for functions that are used just once. (more) |
— | over 1 year ago |
Edit | Post #282777 |
Post edited: who → that |
— | over 1 year ago |
Suggested Edit | Post #282777 |
Suggested edit: who → that (more) |
helpful | over 1 year ago |
Comment | Post #288884 |
I second the need to know SQL but ORMs also simplify stuff. It doesn't have to get very complicated to profit from an automatic mapping between objects and records in a database. It takes away the boilerplate code to do this manually or to write an abstraction which ends up being somewhat an ORM itse... (more) |
— | over 1 year ago |
Comment | Post #285715 |
The point is that it would not make sense to add references to C in C++ if there are no differences, or even advantages to introduce references in addition to pointers. References give some guarantees that can be leveraged by the compiler. Also the source code might read a bit cleaner without the ne... (more) |
— | over 1 year ago |
Comment | Post #288685 |
Useless use of `cat`. It shouldn't be `cat file.txt | wc` but `< file.txt wc` (or `wc < file.txt`). :-)
I don't think just picking any one of the three for a start is a good idea. It is harder to script something with `expect` than to provide command line options. And it is harder to route some o... (more) |
— | over 1 year ago |
Comment | Post #288560 |
I would just use [Gio](https://docs.gtk.org/gio/index.html), then there is just the Glib mainloop. (more) |
— | over 1 year ago |
Comment | Post #288257 |
What's confusing/difficult about it? The < should be known from redirecting IO, which your solution also uses, and the parenthesis are known from running something in a subshell.
Also when or even *if* the `/tmp/` directory gets cleaned up depends on the distribution. Even if it is on reboot, tha... (more) |
— | over 1 year ago |
Comment | Post #288299 |
If there is a database with ”permanent” test data, opposed to data that is part of the tests, then one could/should use the same scripts to change the data, for instance dropping a column, that are used to change the real data.
Are you using any tool or library to change/migrate schema changes? L... (more) |
— | over 1 year ago |
Edit | Post #281477 |
Post edited: Fixed typo |
— | over 1 year ago |
Suggested Edit | Post #281477 |
Suggested edit: Fixed typo (more) |
helpful | over 1 year ago |
Edit | Post #288203 | Initial revision | — | over 1 year ago |
Answer | — |
A: Generating nested repeating values with JSON Generator Instead of nesting this in another loop, you could simply calculate the value of `"code"` from the value of `index()`. It's the remainder of the division by 25: ```json [ '{{repeat(100)}}', { "id": "{{index()}}", "name": "{{random('long', 'string', 'with', 'name', 'values')}}... (more) |
— | over 1 year ago |
Comment | Post #288085 |
It's not an example server but network infrastructure that may delay traffic for any number of reasons longer than any arbitrary timeout you may define to ”detect” the end of the message. (more) |
— | over 1 year ago |
Comment | Post #288085 |
Yes of course, you can write broken code. And put it on the internet, as an ”answer”, so others can copy that broken code. I think it's a disservice and should not have a place on a Q&A site that aims to curate good, correct, answers. This one isn't even correct. The correct answer to this question... (more) |
— | over 1 year ago |
Comment | Post #288085 |
There's nothing you can do. It's impossible. Setting a timeout doesn't guarantee the received data is a complete message. (more) |
— | over 1 year ago |
Comment | Post #287884 |
I'd say the alledged „Un-intuitive and long“ ”workaround” is the solution. (more) |
— | almost 2 years ago |
Edit | Post #287934 |
Post edited: |
— | almost 2 years ago |
Edit | Post #287934 | Initial revision | — | almost 2 years ago |
Answer | — |
A: Why are commas not needed for modulo string formatting when printing? It is, as you said, an operator so it doesn't make any sense to place a comma somewhere between the operator and the two operands. The first operand is the template string, and the second operand is the tuple with the values to format into the template string. The `print()` function gets one argume... (more) |
— | almost 2 years ago |
Comment | Post #286904 |
The lists are one element to long I think. If you input 14 you should get 14 elements, not 15. (more) |
— | over 2 years ago |
Edit | Post #286822 |
Post edited: Adding latex as language to code block with LaTeX source so it doen't render as CSS source code. |
— | over 2 years ago |
Comment | Post #286780 |
As you mentioned LaTeX in another, similar question, I would recommend against using/saving a pixel image. When you save the figure(s) in PDF or EPS format, they can be included as vector graphic in the LaTeX document to get good quality at any resolution without the need to include very high resolu... (more) |
— | over 2 years ago |
Suggested Edit | Post #286822 |
Suggested edit: Adding latex as language to code block with LaTeX source so it doen't render as CSS source code. (more) |
helpful | over 2 years ago |
Edit | Post #285218 |
Post edited: Restore the tags of the original question. |
— | over 2 years ago |
Suggested Edit | Post #285218 |
Suggested edit: Restore the tags of the original question. (more) |
helpful | over 2 years ago |
Comment | Post #284649 |
There are some other use cases besides reusing functions and classes:
1) Debugging: You can import the module in an interpreter and live test single functions.
2) Automatic testing a.k.a. unit tests.
3) Tools to analyse or document the module sometimes import modules too. For instance Sphinx, th... (more) |
— | over 2 years ago |
Comment | Post #285813 |
Those are both function declarations, not calls. When you call those then you pass a pointer to the array in the first case and a pointer to a function in the second case. In neither case it is call by reference. (more) |
— | over 2 years ago |