Search:

Type: Posts; User: Yonut

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. I did come across that link, but the site clearly...

    I did come across that link, but the site clearly doesn't check it's work once posted. I found a bunch of problems with this code. For example, the following function:


    // Calculating the Check...
  2. I just noticed something strange. I ran the...

    I just noticed something strange. I ran the program, and while it was hanging and not responding, I opened a terminal and ran `ping 8.8.8.8`. While ping ran, my program actually returned...
  3. Sorry, I don't get those errors, but it's because...

    Sorry, I don't get those errors, but it's because of my gcc compile options. I'm compiling with:

    gcc -Wall -Werror -Wextra -Wfatal-errors -D_GNU_SOURCE -O3 -o ./pinger pinger.c
  4. Simple ping routine, not receiving anything.

    Hi,

    I'm trying to create a simple ping routine, that can be used in other programs to test internet connectivity. I'm stuck, as the following code seems to send the request, but `recvfrom` blocks...
  5. Replies
    24
    Views
    7,929

    Really?!? So an exclamation mark (!) in a...

    OK, but I still don't understand what you mean by "safe". All characters that you might find in a file name are "safe" (otherwise the OS wouldn't have let you use them in a file name in the first...
  6. Replies
    24
    Views
    7,929

    Why does it have to be the same process? Can't...

    Why does it have to be the same process? Can't one fix the names and another display them.

    And I'm using `stat` before `rename` with the new filename, to make sure it isn't replacing an existing...
  7. Replies
    24
    Views
    7,929

    Don't remember asking people to do something for...

    Don't remember asking people to do something for me. In fact, the OP was about how `strspn` has trouble handling the pound symbol `#`.

    And for the 'management' portion of your code, what happens...
  8. Replies
    24
    Views
    7,929

    If the questions are from you wanting me to...

    If the questions are from you wanting me to 'consider this', then maybe you should answer them.

    As for non-displayed ASCII characters, how many files have you downloaded or created that have...
  9. Replies
    24
    Views
    7,929

    This is what I test to see if I need to change...

    This is what I test to see if I need to change the filename:

    if(strlen(filename) != strcspn(filename, SPECIAL_CHARS))

    And this is what I use while changing the filename.

    for(size_t x = 0; x...
  10. Replies
    24
    Views
    7,929

    Actually, following the course of the...

    Actually, following the course of the conversation, you would notice that I changed my use of `strspn` to `strcsnp`, which does the following:

    1) If there are no special characters, it returns the...
  11. Replies
    24
    Views
    7,929

    Your right. My local copy of `man strcspn` does...

    Your right. My local copy of `man strcspn` does not list what errors, or what happens if it is not found. I read somewhere that `strspn` returns 0 when not found. But, I wrongly assumed that 0 in...
  12. Replies
    24
    Views
    7,929

    Ok, `strcspn` doesn't work. `strcspn` does the...

    Ok, `strcspn` doesn't work. `strcspn` does the exact opposite of my first problem. Yes, it solves the problem of the location with `there#`, but not `#here`. And `strchr` won't work without extra...
  13. Replies
    24
    Views
    7,929

    Ty, I will look into these.

    Ty, I will look into these.
  14. Replies
    24
    Views
    7,929

    Ok, this must be related to `strspn`: #include...

    Ok, this must be related to `strspn`:

    #include <stdio.h>
    #include <string.h>

    int main (int argc, char *argv[])
    {
    printf("Location: %lu\n", strspn(argv[1], "#"));

    for(size_t x = 0;...
  15. Replies
    24
    Views
    7,929

    Sorry, must have cut the function name instead of...

    Sorry, must have cut the function name instead of copying it.

    #include <stdio.h>
    #include <string.h>

    int main (int argc, char *argv[])
    {
    printf("Location: %lu\n", strspn(argv[1], "#"));...
  16. Replies
    24
    Views
    7,929

    strspn problems with '#' character.

    I have noticed a problem that I can't explain.

    When using `strspn`, it won't recognize the pound symbol unless it's the first character in the string.

    Create 2 files:

    touch "#here" "there#"...
  17. Replies
    5
    Views
    5,551

    I wrote my "entertainment system" in C as a way...

    I wrote my "entertainment system" in C as a way to relax. It has been morphing over the past 12 years. My "entertainment system" can offer me TV Shows, Movies, Games, Images and Music. In all...
  18. Replies
    11
    Views
    2,323

    Real world example: I have two boxes. One box...

    Real world example:

    I have two boxes. One box contains nothing, we'll say it's equal to 0. The other box contains and apple, we'll say it's equal to 1.

    Now if we do the 'infinite series' to...
  19. Replies
    11
    Views
    2,323

    What you just said contains the problem. The...

    What you just said contains the problem. The sequence 1/2 + 1/4 + 1/8 + 1/16 + ... never equals one. No matter how far into "infinity" you go. That theory suggests that the moment you stop the...
  20. Replies
    11
    Views
    2,323

    This is better than what I was going to resort...

    This is better than what I was going to resort to, thank you.


    I have a problem with this video. They talk about the fundamental flaw in 'Maths', but he is talking with infinities. I don't know...
  21. Replies
    11
    Views
    2,323

    Yes and yes. 0 for completed download. 1 for...

    Yes and yes. 0 for completed download. 1 for download incomplete for a myriad of reasons (bad link, interrupted download, no internet connection...). Basically, if it's 0, remove the window.

    It...
  22. Replies
    11
    Views
    2,323

    I am determining success from the return code of...

    I am determining success from the return code of `yt-dlp`. Or at least, I'd like to.


    I understand where you're coming from. I have seen the types of questions you occasionally get here. But I...
  23. Replies
    11
    Views
    2,323

    Logical AND in execl()?

    Hi,

    I'm trying to create a program that will grab the contents of the clipboard (youtube video link), and download the video. DONE.

    Problem encounter is that I need to know if a video was...
  24. Might this have been created by AI?

    Might this have been created by AI?
  25. Replies
    11
    Views
    3,263

    Sorry, I just noticed this. The reason why I use...

    Sorry, I just noticed this. The reason why I use `basename` on the program name (or argv[0]) is because argv[0] depends on where and how the program is called.


    ie:
    $ run_my_program (in $PATH) ...
Results 1 to 25 of 119
Page 1 of 5 1 2 3 4