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 elgonzoâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #285579 |
Any code that is not part of the C source code (such as a function provided by some object/machine code written in assembler) has its behavior obviously not described by the C source code nor the C standard, and from the perspective of C is thusly undefined behavior. (In other words, neither the C st... (more) |
— | almost 3 years ago |
Comment | Post #285579 |
> This would mean that every kernel ever written that has any I/O of any kind is not standards-compliant C.
Incorrect. You cannot become non-compliant by "violating" non-existing parts of the standard.
With regard to linking object/machine code that is written in other languages then C (like f... (more) |
— | almost 3 years ago |
Comment | Post #285579 |
> If so, there should be reference to it within the C standard somewhere, and I'd like to know exactly what can be said about linking C translation units with other non-C libraries.
It is implementation-defined, and therefore not described nor referenced in the C standard, precisely because differ... (more) |
— | almost 3 years ago |
Comment | Post #285580 |
> Therefore, the C standard cannot confine itself solely to rules applying to a single translation unit; it must have something to say about linking.
It does. See section 6.2.2 Linkages of identifiers. In case you don't have the actual C standard at hand, here is the PDF for C18: http://www.open-s... (more) |
— | almost 3 years ago |
Comment | Post #285580 |
> By that reasoning, if a function is never defined, the program should fail to compile.
If your code calls some externally defined function, and the linker is unable to link the call with the actual function implementation because there is no such function implementation, of course the build will... (more) |
— | almost 3 years ago |
Comment | Post #285580 |
(2/2) Compilers might (and often do) provide additional keyword extensions not covered by the C standard to allow specifying a particular calling convention (such as `_stdcall`, `_cdecl` or `_fastcall`, for example).
If your interrogation of "_[...] from the standard's perspective, what happens wh... (more) |
— | almost 3 years ago |
Comment | Post #285580 |
I am not quite sure what you are trying to ask about, but i am assuming for now you are asking wrt calling conventions. The C standard is unconcerned about calling conventions and does not try to lay down a "law" about that. It explicitly leaves the layout of storage for parameters of externally defi... (more) |
— | almost 3 years ago |
Comment | Post #285573 |
I am not trying to be facetious or snarky here. A debugger is a fundamental software development tool. I would go as a far as saying that a debugger is almost as fundamental as the text editor function required to write and edit source code and the compiler or interpreter required for processing the ... (more) |
— | almost 3 years ago |
Comment | Post #285573 |
> Why is it like that?
If you have difficulties understanding what your program is doing and just looking at the source code doesn't help you get an understanding, then it's time to use a debugger to inspect and observe what your code/program is actually doing, and why it behaves the way it does..... (more) |
— | almost 3 years ago |
Comment | Post #285573 |
See comment topic title, obviously...
(There is a way to make the data type available as a data type named "Node", but i won't tell you here right now because i believe doing so would confuse you even more...) (more) |
— | almost 3 years ago |
Comment | Post #285558 |
All in all, without making sweeping assumptions about what specific CPU SKUs are in the nodes the asker is using, i think the Win32_Processor caption string provided by WMI is not that practical, unless you already have a table that maps CPU family/generation + (extended) model number to feature set.... (more) |
— | almost 3 years ago |
Comment | Post #285558 |
> The AVX2 features were introduced in the Haswell family of chips, which I believe will show up as family 6, model 195. Models older than that can use the non-AVX2 build.
With respect to Intel, if it only were that easy. Not all Intel processors in the same family/architecture do support AVX2. Fo... (more) |
— | almost 3 years ago |
Edit | Post #285351 |
Post edited: Typo? The compiler is not the allocating the memory, the malloc function does that when the program is executed and invokes malloc :-) |
— | almost 3 years ago |
Suggested Edit | Post #285351 |
Suggested edit: Typo? The compiler is not the allocating the memory, the malloc function does that when the program is executed and invokes malloc :-) (more) |
helpful | almost 3 years ago |
Comment | Post #285205 |
@#54710 (2/2) Only if you have accomplished these three tasks (write text lines to a file; read text lines from one file and write them to another file; using strstr) individually and independently, **and only then**, it is time for the concluding task: Combine the text line reading and writing with ... (more) |
— | almost 3 years ago |
Comment | Post #285205 |
@#54710 Start with figuring out how to _write_ strings/text lines to a (new) file. Don't think about finding and removing text lines, yet. Solve this task first. Exercise it, make it work successfully.
If you have accomplished that, figure out how to read a text line from a file and write it to an... (more) |
— | almost 3 years ago |
Comment | Post #285303 |
@#54710 https://software.codidact.com/comments/thread/5285 (more) |
— | almost 3 years ago |
Comment | Post #285298 |
Don't make your life more difficult than you have to. Do you really want to find a word (in the orthographic sense) in some text line of your text file? At your current skill level, this would not be trivial for you, a fountain of frustration and a distraction rife with disappointment.
Searching f... (more) |
— | almost 3 years ago |
Comment | Post #285205 |
@#54710, no, there is no such function available -- not as a single function. Modifying file content is highly specific to the individual application scenario or use case. Since this cannot be really well generalized to cover a wide gamut of use cases, you will be hard pressed to find any such a func... (more) |
— | almost 3 years ago |
Comment | Post #285191 |
Ajax is frontend-side (client-side). If you want to keep the email address in the backend (server-side), then it is a backend concern, not a frontend/Ajax concern. Therefore, the answer to your question "_What Ajax pattern will you use to do so?_" will be "_None_", because it is of no concern to the ... (more) |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 |
Post edited: |
— | almost 3 years ago |
Edit | Post #285200 | Initial revision | — | almost 3 years ago |
Answer | — |
A: Uncaught TypeError: Failed to construct 'FormData' Your Javascript code uses the following selector for the document.querySelector(...) invocation: ``` #prcfform ``` The selector string starting with an `#` indicates an ID selector, with the actual ID following the `#`. Note that in a selector string, the leading `#` is not part of the ID to be s... (more) |
— | almost 3 years ago |
Comment | Post #285183 |
For now i personally feel it would serve you much better if you separate both concerns (modelling you application/business logic + data structures vs. the implementation of the logic + data structures), and try to do them separately and sequentially as much as possible.
In the future, if you have ... (more) |
— | almost 3 years ago |
Comment | Post #285183 |
Before you start coding/implementing, spend some effort in actually designing/modelling both the desired application/business logic and the related data structures in detail and completely.
From your code snippet, it rather looks like that you started coding just with a vague notion but lacking a ... (more) |
— | almost 3 years ago |
Comment | Post #285177 |
Because the array can be thought of as a representation of a binary tree, specifically a "**complete binary tree**". Now, if you know the array index of some node/element in the tree, how would you get the array indices of the two children nodes/elements, or the array index of the parent node/element... (more) |
— | almost 3 years ago |
Comment | Post #285177 |
... in other words "heapify" describes the act of turning something into a heap data structure. Within the context of heapsort, this describes turning a binary tree into a "max heap" / "binary heap". The `heapify()` method does just that. (Btw, a max/binary heap is just a binary tree obeying specific... (more) |
— | almost 3 years ago |
Comment | Post #285130 |
Ah, i see. I unfortunately cannot offer help with your problem. However, you might perhaps mention in your question that your frontend is using Ajax, and which thusly might encourage Ajax-based solutions that might be simpler/easier than plain/pure non-Ajax JavaScript (unless you seek a solution that... (more) |
— | almost 3 years ago |
Comment | Post #285135 |
From one of the documentation pages for fopen (https://linux.die.net/man/3/fopen):
> Upon successful completion fopen(), fdopen() and freopen() return a FILE pointer. **Otherwise, NULL is returned and _errno_ is set to indicate the error.**
> The fopen() function may also fail and set _errno_ ... (more) |
— | almost 3 years ago |
Comment | Post #285130 |
What exactly are your reasons to prevent the default behavior? Actually, what precisely is the behavior that you summarily describe as "default behavior" and that you desire to prevent?
Have you thought about _not_ preventing that "default behavior" but just preventing the user from triggering the... (more) |
— | almost 3 years ago |
Comment | Post #285130 |
@#36363
> (perhaps you meant to say that they should be the same?).
No, i did not say this, and i did not mean to say this either. I just said that you have to use the correct URL, whatever the actual correct URL is. (I am not going to wildly speculate about what the correct URL might be. You are... (more) |
— | almost 3 years ago |
Comment | Post #285130 |
@#36363, the endpoint of a request is given by a URL, not a file. If the URL itself specifies some file name, then it's just part of that URL. The correct URL for a request (and what data and in what shape that data has to be included in the request) depends on how you have the backend implemented an... (more) |
— | almost 3 years ago |
Comment | Post #285130 |
If you are looking for examples of how to make requests with the `fetch()` method (including POST requests), you might want to take a look here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch (more) |
— | almost 3 years ago |
Comment | Post #285130 |
`fetch()` is chiefly about making requests, and is not about "actions" or "php". So why would you expect `fetch()`'s documentation to say something about random things that are not about requests themselves?
And how you should realize your `fetch()` or `submit()` depends entirely on **how** you h... (more) |
— | almost 3 years ago |
Comment | Post #285118 |
Clearly, `compare` is a function pointer **and** an input parameter for the BubbleSort method. But in your _main_ method, you don't provide a function pointer there: `BubbleSort(A,6);` What do you think will happen because of that omission?
Furthermore, with regard to your Q "_What does the grea... (more) |
— | almost 3 years ago |
Comment | Post #285068 |
Whether TamperMonkey offers alternative mechanisms for fragment matching, i don't know. But even if it would have such a mechanism, I would have a hard time understanding how this could possibly work satisfactorily. Navigation based on URL fragment where the scheme/host/path of the URLs stays the sam... (more) |
— | almost 3 years ago |
Comment | Post #285068 |
The question then boils down to how could you possibly match against a given fragment in a URL. Frankly and unfortunately, i don't know. Content script match patterns basically can match schemes, hosts, and paths (https://developer.chrome.com/docs/extensions/mv3/match_patterns/). Note that it does no... (more) |
— | almost 3 years ago |