Search:

Type: Posts; User: GReaper

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    12
    Views
    281

    You don't take into account padding on xPos and...

    You don't take into account padding on xPos and xEndPos.
  2. Replies
    24
    Views
    680

    Thank you, I now know what "crewel" means. :D

    Thank you, I now know what "crewel" means. :D
  3. Replies
    24
    Views
    680

    It turns out that the "add 1022/1023" part is a...

    It turns out that the "add 1022/1023" part is a misunderstanding, the challenge just wants you to extract the exponent part of the double value.
  4. Replies
    24
    Views
    680

    I think I came up with a solution. It involves a...

    I think I came up with a solution. It involves a union, a struct and a bitfield... think about it.
  5. Replies
    24
    Views
    680

    What does the task say, exactly? Can you give a...

    What does the task say, exactly? Can you give a link or something?
  6. Replies
    24
    Views
    680

    What are you allowed to use? This is...

    What are you allowed to use? This is ridiculous... I don't think it's possible, at least not without some assembly hacking.

    EDIT: I just had a wacky idea. How about this? It uses a file counter to...
  7. Replies
    24
    Views
    680

    Sure. I take advantage of the fact that array...

    Sure. I take advantage of the fact that array indexing just adds an offset to a pointer. I convert the integer returned by frexp() into a pointer, index it and immediately take that "element's"...
  8. Replies
    24
    Views
    680

    Do you mean that you (a) want the absolute value...

    Do you mean that you (a) want the absolute value or (b) that you want to shift the result +1022 out of the negative?

    a) Simply use fabs()
    b) Now, this can be difficult without any arithmetic or...
  9. Replies
    13
    Views
    335

    I had only heard about oct-trees until I...

    I had only heard about oct-trees until I implemented my own voxel renderer (minecraft clone :D). Ahh, it feels so nice to be able to have 1024x1024 chunks at 60 fps. :p
  10. Replies
    25
    Views
    660

    It's not the IDE's fault you tend to...

    It's not the IDE's fault you tend to misunderstand the effects of a piece of code and of your edits to it. Stop blaming your tools, it's not the knife's fault you cut yourself...
  11. There you go. The link was in the description....

    There you go. The link was in the description.
    GitHub - alugocp/gamepad
  12. I knew that, but I've shamelessly ignored it so...

    For struct _some_name, the name is presumably declared at file scope, and _some_name is in the tag name space of struct. Therefore, the name is not merely "reserved", but really is reserved to the...
  13. Unless I'm referring to the struct inside itself,...

    Unless I'm referring to the struct inside itself, I always use this:


    typedef struct {
    // variables here
    } some_name;


    If I have to though, I give it a "reserved" name:
  14. Replies
    7
    Views
    257

    Of course, an experienced programmer knows when...

    Of course, an experienced programmer knows when it's wise to ignore blanket statements like "never use goto".

    The reason goto is shunned is probably because many assembly programmers back in the...
  15. You can't divide by zero. Dividing zero by...

    You can't divide by zero. Dividing zero by anything (other than zero) is certainly not an error.
  16. Replies
    5
    Views
    419

    fread() take the same arguments, and transfers...

    fread() take the same arguments, and transfers data from the file to memory. Try it. Don't forget to open the file with "rb" though.

    Also, just a bit of advice, don't typedef pointers. Obscuring a...
  17. Yes, that probably happens because the last line...

    Yes, that probably happens because the last line has no '\n' character. To fix that bug, you could count the amount of characters in the current line, and if you reach EOF while the amount is greater...
  18. I've never seen use of "t", and I don't think...

    I've never seen use of "t", and I don't think it's part of the standard. A file stream defaults to text mode anyway.
  19. You're opening the file for appending("a")...

    You're opening the file for appending("a") instead of reading("r").
  20. Replies
    8
    Views
    289

    If your microcontroller overheats and the...

    If your microcontroller overheats and the embedded system has an automatic thermal shutdown system, then sure. But nothing should be taken for granted in these situations.
  21. Thread: XOR vs ^

    by GReaper
    Replies
    12
    Views
    359

    It's a bit complicated, but nothing difficult....

    It's a bit complicated, but nothing difficult. The problem definition had me confused for a minute, but the following explanation made the task much clearer.

    A permutation is a specific...
  22. Thread: XOR vs ^

    by GReaper
    Replies
    12
    Views
    359

    It shouldn't. The correct answer is 5. Are you...

    It shouldn't. The correct answer is 5. Are you sure you didn't do something wrong?
  23. Replies
    4
    Views
    190

    In C, enum values are global. They're like fancy...

    In C, enum values are global. They're like fancy #define constants. If you don't want their names to conflict, you need to either give them different ones or add some sort of prefix that...
  24. Replies
    1
    Views
    179

    I don't know jack about poker, but this...

    I don't know jack about poker, but this stackoverflow answer seems like it explains it pretty good:
    Algorithm to give a value to a 5 card Poker hand - Stack Overflow
  25. Replies
    3
    Views
    184

    Oh, my bad, I didn't clarify. It's a specifier...

    Oh, my bad, I didn't clarify. It's a specifier that (in this context) defines a range, and it has a formal name, "ellipsis". It's always "...", three full-stops with no white-space in-between.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4