Search:

Type: Posts; User: QuadraticFighte

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,185

    Passphrase-Protecting a File

    My question: How can one programmatically passphrase-protect a file? I know that we can do it with PGP and other cryptography software, but how does it actually work? I don't really care about what...
  2. The area under the curve is "total" not "area"....

    The area under the curve is "total" not "area". You are calculating the discrete sum correctly though: just add up the trapezoid areas. Even if you lose 10%, you can rest assured that while you need...
  3. Maybe for that particular purpose, but there are...

    Maybe for that particular purpose, but there are good uses of goto.
  4. Replies
    2
    Views
    2,061

    Oh ........ ya, parens worked fine there. Thanks.

    Oh ........ ya, parens worked fine there. Thanks.
  5. Replies
    2
    Views
    2,061

    Bitwise AND -> equality test

    I am trying to write a bitmapped memory manager just for the exercise of doing it, and I am having trouble with a little function I am trying to write. The idea of it is that it does a simple linear...
  6. Replies
    11
    Views
    1,662

    Microsoft is full of meanies who tried to kill...

    Microsoft is full of meanies who tried to kill OpenGL, so now we have to use function pointers for any OpenGL past the stone age. :(
  7. Replies
    5
    Views
    1,508

    Could you please show us the line where the error...

    Could you please show us the line where the error is? I don't think this code is complete as I am scanning for a brace ending main() and not finding it. Is there more to this program?

    Welcome to...
  8. Replies
    19
    Views
    2,692

    The GNU compiler collection is quite nice in my...

    The GNU compiler collection is quite nice in my opinion, but my only reference experience is with gcc and MSVC. DevC++ is an awful IDE made of pain.
  9. Replies
    5
    Views
    1,042

    We have no idea what happens. The fork system...

    We have no idea what happens. The fork system call requests the operating system to make another process and execution continues from there. In my opinion, the way fork should be called is:


    int...
  10. Replies
    8
    Views
    35,154

    Don't get too fancy with pointer arithmetic. It's...

    Don't get too fancy with pointer arithmetic. It's pt[i].roll. If you really really really want to do the pointer arithmetic explicitly, you will have to do this:

    *((REC*)(pt+i))->roll
    This is...
  11. Replies
    6
    Views
    985

    Start with #include int...

    Start with



    #include <stdio.h>

    int main(int argc, char** argv)
    {
    return 0;
    }
  12. The title of this post is "How to convert float...

    The title of this post is "How to convert float to string without using sprintf()"

    The man page for strtod says "convert ASCII string to floating-point number."

    It could be that I totally...
  13. Replies
    7
    Views
    1,205

    Surely true, which is why I liked your approach.

    Surely true, which is why I liked your approach.
  14. Replies
    7
    Views
    1,205

    Actually do that. That's a much better solution...

    Actually do that. That's a much better solution then mine, because actually, if you got numbers big enough, you could overflow several times over and still have (n+1)! < n!
  15. Why do you want to avoid sprintf? It's the...

    Why do you want to avoid sprintf? It's the preferred solution according to my cursory looks at Google. Anyway's here's the other way:


    ECVT(3) Linux Programmer's Manual ...
  16. Replies
    8
    Views
    2,738

    You have two posts. This one, and one about...

    You have two posts. This one, and one about looking for a developer. You have never asked a programming question here. I answer programming questions sometimes until the wee hours of the morning, and...
  17. Replies
    7
    Views
    1,205

    A crude way of doing it is to keep going until...

    A crude way of doing it is to keep going until the result is less than what you got before. When I tried it on a 32-bit signed integer, I got that:


    i= 1 i!= 1
    i= 2 i!= 2
    i= 3 i!= 6
    i= 4 i!=...
  18. Replies
    5
    Views
    1,246

    1) Floats are bad for money because of arithmetic...

    1) Floats are bad for money because of arithmetic problems
    2) The formatting you want for xx.xx is printf("%05.2f\n", amount);

    The format specifier %05.2f means "Output a float 5 characters long,...
  19. Replies
    10
    Views
    1,556

    I will take a wild stab in the dark and say that...

    I will take a wild stab in the dark and say that you have uninitialized values, because l is negative and hugely off-base while r is positive and hugely off-base.
  20. itsme86: Yes, hahahaha. Well at least your snipe...

    itsme86: Yes, hahahaha. Well at least your snipe taught me something about GLib. I learned that GLib is annoying:




    #include <stdlib.h>
    #include <stdio.h>
    #include <glib.h>

    // Because...
  21. I knew it was a mistake to post C++ code. I don't...

    I knew it was a mistake to post C++ code. I don't know of any equivalents for a dictionary/map in C except for like a GHashTable (see <glib.h>) Unfortunately, I have no experience with glib. I can...
  22. Hold on, I am working on a C++ implementation of...

    Hold on, I am working on a C++ implementation of a naive prime factorization for fun. I'll post it when I refine it (about 10 minutes)

    EDIT: I know this is C++ code and technically shouldn't go...
  23. 1) Tt is the running time you're concerned about....

    1) Tt is the running time you're concerned about. I am sure it compiles very very very fast.
    2) You can speed it up by noticing that no odd perfect numbers have yet been discovered. Certainly you...
  24. Replies
    9
    Views
    1,823

    Wow, that's super nifty. I never quite understood...

    Wow, that's super nifty. I never quite understood how the & worked in that context. So that assures that int*'s are passed by reference?
  25. Replies
    6
    Views
    1,187

    I have a strange sense of humor.

    I have a strange sense of humor.
Results 1 to 25 of 108
Page 1 of 5 1 2 3 4