Search:

Type: Posts; User: eros

Search: Search took 0.00 seconds.

  1. Replies
    0
    Views
    3,501

    Class vs. Namespace as Singleton

    I was looking across some code and I found an unusual technique to implement public singletons. I have never seen this code style before in any code.

    Here's an example of generic singleton code:
    ...
  2. Replies
    4
    Views
    1,271

    if(board[1] == "XXX") return 1;

    if(board[1] == "XXX") return 1;
  3. Thread: Newton's Method

    by eros
    Replies
    33
    Views
    22,768

    Using Newton's Method, yes i did.

    Using Newton's Method, yes i did.
  4. Thread: Newton's Method

    by eros
    Replies
    33
    Views
    22,768

    This is what i came up with, not the most...

    This is what i came up with, not the most efficient but it works

    double Sqrt(double num)
    {
    return Guess(num/2, num, 0, 256);
    }
    double Guess(double x, double y, int depth, int maxDepth)
    {...
  5. Thread: Make it fast !

    by eros
    Replies
    32
    Views
    3,191

    Thanks for the idea anduril462, it would be very...

    Thanks for the idea anduril462, it would be very hard to impliment in my situation. But ill give it a shot soon.

    This is what i got from Taters method, it is faster:


    BOOL valid(BYTE *file,...
  6. Thread: Make it fast !

    by eros
    Replies
    32
    Views
    3,191

    Slightly faster... int DLL_EXPORT ScanSig(...

    Slightly faster...


    int DLL_EXPORT ScanSig(
    BYTE *file,
    int fileLen,
    short *sig,
    int sigLen)
    {
    int i, j;
  7. Thread: Make it fast !

    by eros
    Replies
    32
    Views
    3,191

    whiteflags, BYTE file[] would be a standard PE...

    whiteflags,

    BYTE file[] would be a standard PE file. Ranging from 150 bytes to 20mb in length.

    short sig[] would be a pattern of shorts, including wildcards. Such as



    short sig[] = {...
  8. Thread: Make it fast !

    by eros
    Replies
    32
    Views
    3,191

    Make it fast !

    I have this scanning routine:


    int DLL_EXPORT scansig(
    BYTE file[],
    int fileLen,
    short sig[],
    int sigLen)
    {
    int i, j;
  9. Replies
    15
    Views
    4,921

    Check out Processing.js...

    Check out Processing.js
    This fits your situation!
  10. Thread: Which is faster?

    by eros
    Replies
    3
    Views
    2,332

    Thanks for the quick response. That's good to...

    Thanks for the quick response.

    That's good to know.

    But what about the part were the function takes only a float and returns a float. Wouldn't casting or converting numbers to floats be slower...
  11. Thread: Which is faster?

    by eros
    Replies
    3
    Views
    2,332

    Which is faster?

    I'm still learning C, and wondering which of these 2 are faster/more efficient and better programming practice.


    #define sq(x) x*x

    OR


    float sq(float x) { return x * x; }
Results 1 to 11 of 11