Search:

Type: Posts; User: Aisthesis

Page 1 of 10 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    1,044

    Bit shifting and Endianness

    If one writes in C or C++

    int x = 1 << 2;
    Is it guaranteed regardless of platform that x is now 4? I was thinking it would have to be, but a friend was claiming that on some platforms the value...
  2. Replies
    1
    Views
    2,607

    Boost setup with Xcode

    I'm trying to use Boost for unit testing on Xcode and am having trouble getting things to link properly.

    I put the boost download into the directory (on my Mac with Lion) /usr/local/boost_1_49_0....
  3. Replies
    23
    Views
    13,936

    here's my current code for hasher() and...

    here's my current code for hasher() and hasher_update():


    size_t phantom::xor_hasher(const std::string &s) {
    size_t len = s.size();
    assert (len > 0);

    unsigned int result = 0U;
    ...
  4. Replies
    23
    Views
    13,936

    substituting operator[] for at() in all character...

    substituting operator[] for at() in all character retrievals from string, here's a sample run:

    first string and pattern:
    div method: 1.679
    xor method with global array: 3.087

    second string...
  5. Replies
    23
    Views
    13,936

    the .at() gets eliminated in the array version...

    the .at() gets eliminated in the array version (which speeds it up to double the time of the div method), at least for the array. and all other instances (with the string) are identical for all 3...
  6. Replies
    7
    Views
    4,366

    so it compiles but always prints "Failed to...

    so it compiles but always prints "Failed to insert uniform"?

    if so, maybe set a breakpoint at the this->uniforms.insert(pair...); line and see if the debugger tells you anything useful.

    if it...
  7. Replies
    23
    Views
    13,936

    the only part i didn't test for was not having at...

    the only part i didn't test for was not having at least 7 bits in common with any neighbor. i did get uniform distribution and just used std::random_shuffle() after all and left it at that.
    ...
  8. Replies
    23
    Views
    13,936

    phantom, using your exact code (deleting...

    phantom, using your exact code (deleting superfluous lines from my original that have no relevance for xor and running it through a global array rather than the PrimeArray class), it improves (about...
  9. Replies
    23
    Views
    13,936

    uh... phantom, aside from some names and deleting...

    uh... phantom, aside from some names and deleting unused code, the only thing i really changed was making the keys array into a class so that i could use the constructor to make it fit the desired...
  10. Thread: need help

    by Aisthesis
    Replies
    5
    Views
    1,601

    i'm not sure exactly what the program is doing if...

    i'm not sure exactly what the program is doing if you code it like that, but you haven't allocated any memory for the pointers (are they perhaps all pointing to NULL prior to being allocated?).
    ...
  11. Replies
    23
    Views
    13,936

    oddly enough, phantom, the xor implementation...

    oddly enough, phantom, the xor implementation seems slower by almost a factor of 3 than the division method. On my laptop, I get somewhere around 1.8 with division and 4.5 with XOR on the first...
  12. Replies
    24
    Views
    1,651

    i think elysia is talking about what i call...

    i think elysia is talking about what i call absolute and relative paths. absolute (explicit) means that you spell out the entire path all the way from the root (e.g., in Windows, c:\Users\...)...
  13. Replies
    23
    Views
    13,936

    just looking at a few entries in it, the...

    just looking at a few entries in it, the distribution looks reasonable to me.
  14. Replies
    23
    Views
    13,936

    first ignoring the (easy) issue of randomizing...

    first ignoring the (easy) issue of randomizing the order of the keys[] array, here's the way i'm initially populating it:

    i implement it as a simple class:


    class PrimeArray {
    private:...
  15. Replies
    23
    Views
    13,936

    that makes sense--i might still do it the long...

    that makes sense--i might still do it the long way just for practice with various hashing methods.

    do the primes i was suggesting sound reasonable for the contents of the array prior to shuffling?
  16. Replies
    23
    Views
    13,936

    is random bit distribution the only reason that...

    is random bit distribution the only reason that we want keys[i] to be prime?

    how's this as method for generating keys[]:
    1) for the highest order bits, use a deterministic process to define slots...
  17. Replies
    23
    Views
    13,936

    very interesting. if we restrict ourselves to...

    very interesting. if we restrict ourselves to small ASCII keys could also be only 128 + 128, right?

    and the primes in keys all just need to be bigger than 256, correct? and maybe also a minimum...
  18. Replies
    10
    Views
    5,712

    so the program is supposed to split up the string...

    so the program is supposed to split up the string "Sam Harris" into "Sam" and "Harris" and print out accordingly?

    if so, while i haven't really worked with istringstream objects, getline() should...
  19. a global variable isn't defined inside a class,...

    a global variable isn't defined inside a class, whereas a static variable is. a global variable dies with its file, whereas a static variable dies when no instance of the class in which it is defined...
  20. Replies
    23
    Views
    13,936

    just by running it on some big strings with...

    just by running it on some big strings with different kinds of structures, i came up with an empirically
    "optimal" modulus of something like 1511, although on my minimal sample sets i saw very...
  21. Replies
    23
    Views
    13,936

    Rabin-Karp algorithm

    This is an algorithm for finding a pattern substring in a text string. I got it from Skiena, Design Algorithm Manual, 2008, pp. 91f. It works by hashing the substring and starts getting nice results...
  22. Replies
    19
    Views
    2,340

    unsigned power_of_two(unsigned i) { while(i &...

    unsigned power_of_two(unsigned i) {
    while(i & (i-1))
    i &= i-1;
    return i;
    }


    very nice!
    i do think the modified brewbuck solution will be faster (fewer iterations) if i is often a...
  23. Replies
    9
    Views
    1,067

    visual studio 2010? any way to look at source...

    visual studio 2010?
    any way to look at source code?
  24. Replies
    9
    Views
    1,067

    cool, thanks! as long as there's a good and at...

    cool, thanks! as long as there's a good and at least fairly widely accepted implementation out there, the best way to learn is probably just to study that.
  25. Replies
    9
    Views
    1,067

    so... where does that leave us? i have no desire...

    so... where does that leave us? i have no desire to re-invent the wheel but would like to have a nice hash_map and hash_set

    those linked to look very nicely done
Results 1 to 25 of 243
Page 1 of 10 1 2 3 4