Hashing 2D, 3D and nD vectors

There’s a spatial hash function described in Optimized Spatial Hashing for Collision Detection of Deformable Objects. They use the hash function hash(x,y,z) = ( x p1 xor y p2 xor z p3) mod n where p1, p2, p3 are large prime numbers, in our case 73856093, 19349663, 83492791, respectively. The value n is the hash … Read more

Is order of a Ruby hash literal guaranteed?

There are couple of locations where this could be specified, i.e. a couple of things that are considered “The Ruby Language Specification”: the ISO Ruby Language Specification the RubySpec project the YARV testsuite The Ruby Programming Language book by matz and David Flanagan The ISO spec doesn’t say anything about Hash ordering: it was written … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)