Search:

Type: Posts; User: christop

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    30
    Views
    359

    Hehe, that's what I get for testing stuff with...

    Hehe, that's what I get for testing stuff with Cygwin instead of a real Linux system. Yep, it's "exename" in Cygwin but "comm" in Linux.
  2. Replies
    30
    Views
    359

    There's also /proc/ /exename if you only want...

    There's also /proc/<PID>/exename if you only want the executable name:


    $ cat /proc/self/exename
    /usr/bin/bash

    I think you'll have a problem finding the length of any file under /proc because...
  3. Replies
    11
    Views
    198

    realloc(NULL, size) is exactly the same as...

    realloc(NULL, size) is exactly the same as malloc(size). If you used a compiler that treated them differently, then get a new compiler (I know gcc handles it correctly). I use realloc(NULL, size)...
  4. Does your compiler have warnings enabled? You...

    Does your compiler have warnings enabled? You should have gotten a warning from this line:


    if(check.acc_no = add.acc_no)

    Frankly, there are a lot of problems with this code. For one,...
  5. Replies
    3
    Views
    116

    /bin/sh: glad/glad.h: No such file or directory ...

    /bin/sh: glad/glad.h: No such file or directory

    That's the shell, not the compiler, complaining that it can't find the file glad/glad.h. Do you have the text "glad/glad.h" (or as a result of...
  6. Replies
    72
    Views
    853

    Make it an infinite loop. Dieharder will read as...

    Make it an infinite loop. Dieharder will read as much data as it wants (which is A LOT, or so I've read).
  7. Replies
    72
    Views
    853

    Here's the code I'm testing. I modified flp1969's...

    Here's the code I'm testing. I modified flp1969's code just slightly to produce binary output.

    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    #include <limits.h>

    // using size_t...
  8. Replies
    72
    Views
    853

    It appears so. In any case, the manual gives a...

    It appears so.

    In any case, the manual gives a clear example of the simplest way to test a random-number generator:



    (Just replace "cat /dev/urandom" with "./mcc_rnd_die.elf", and make sure...
  9. Replies
    72
    Views
    853

    I just noticed this part of your dieharder output...

    I just noticed this part of your dieharder output (from 10 hours ago):



    rng_name |rands/second| Seed |
    mt19937| 7.47e+07 |2183355501|


    It looks like dieharder is using...
  10. Thread: C++ Challenge

    by christop
    Replies
    4
    Views
    268

    Yikes! That has O(N) space requirement. In other...

    Yikes! That has O(N) space requirement. In other words, the memory it requires is directly proportional to the length of the list. For example, if your list is 1000000 nodes long and has a loop at...
  11. Replies
    72
    Views
    853

    Is that command doing what you think it does?...

    Is that command doing what you think it does? That command redirects the executable file itself to the standard input of the "dieharder" program. It doesn't execute ./mcc_rnd_die.elf.
  12. Replies
    15
    Views
    371

    By the way, main() returns int, not void. Some...

    By the way, main() returns int, not void. Some 30-plus-year-old compilers like Turbo-C let you get away with it, but it's non-standard.
  13. Replies
    38
    Views
    653

    You can rest assured that incrementing a pointer...

    You can rest assured that incrementing a pointer adds the size of the pointed-to object to the pointer. It's guaranteed by the standards, and it's common practice to use something like ++p to...
  14. Replies
    40
    Views
    1,160

    According to the relevant standard (POSIX), a...

    According to the relevant standard (POSIX), a text file contains zero or more lines of text; each line of text is zero or more characters followed by a single newline character (\n). Put simply,...
  15. Replies
    38
    Views
    653

    Why the obscure code? spot = &(spot[1]) is...

    Why the obscure code? spot = &(spot[1]) is equivalent to ++spot, but the latter is (IMO) easier to read.
  16. It's not. You want to check for an input error,...

    It's not. You want to check for an input error, correct? Checking the return value of sprintf won't do that, but checking the return value of scanf will.
  17. Check the return value of scanf(). It gives you...

    Check the return value of scanf(). It gives you the number of successful conversions.
  18. Replies
    9
    Views
    242

    It's not weird at all. That's how umask works....

    It's not weird at all. That's how umask works. From umask(2) - Linux manual page:
  19. Replies
    2
    Views
    142

    The conventional way is to put declarations in a...

    The conventional way is to put declarations in a header file and definitions in a source file:

    foo.h:


    #ifndef FOO_H
    #define FOO_H

    // declarations
  20. You don't need "extern" on a function...

    You don't need "extern" on a function declaration. Surely you didn't include the function's definition in a header file, right? This is the only part of the function that should be in a header file:...
  21. I haven't read through everything there, but the...

    I haven't read through everything there, but the whole thing about EOF is wrong, to say the least: KernighanRitchieAndSTm32/EndofFile.md at master * akd-jls/KernighanRitchieAndSTm32 * GitHub

    EOF...
  22. Replies
    7
    Views
    416

    Don't they/them/their suffice? They've been...

    Don't they/them/their suffice? They've been acceptable as gender-neutral singular personal pronouns since, oh, the 14th century.
  23. What is your question? What do you need help...

    What is your question? What do you need help with?

    By the way, when I run your code it prints "10", as I would expect.
  24. Replies
    17
    Views
    373

    I wouldn't say it's ruled out. Undefined behavior...

    I wouldn't say it's ruled out. Undefined behavior can show up in any of the following ways:


    The program works as you expected.
    The program crashes.
    The program gives weird results.
    Demons...
  25. Replies
    17
    Views
    373

    That's likely because you used memcpy in an...

    That's likely because you used memcpy in an undefined way (e.g., source and destination overlap). I haven't looked too deeply at your code to see if that's the case, but there's an exceedingly low...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4