What is a good Hash Function?

For doing “normal” hash table lookups on basically any kind of data – this one by Paul Hsieh is the best I’ve ever used. http://www.azillionmonkeys.com/qed/hash.html If you care about cryptographically secure or anything else more advanced, then YMMV. If you just want a kick ass general purpose hash function for a hash table lookup, then … Read more

What is the difference between a map and a dictionary?

Two terms for the same thing: “Map” is used by Java, C++ “Dictionary” is used by .Net, Python “Associative array” is used by PHP “Map” is the correct mathematical term, but it is avoided because it has a separate meaning in functional programming. Some languages use still other terms (“Object” in Javascript, “Hash” in Ruby, “Table” in Lua), but those all … Read more

what does “nulled script” mean?

A nulled script is when somebody changes a script to remove the protection implemented by the author. For example, when they remove call homes or registration checks or etc. These scripts are commonly distributed by shady/warez sites. Although nearly impossible to detect from original author, I have no idea of the legal implications from removing … Read more

What are sessions? How do they work?

Because HTTP is stateless, in order to associate a request to any other request, you need a way to store user data between HTTP requests. Cookies or URL parameters ( for ex. like http://example.com/myPage?asd=lol&boo=no ) are both suitable ways to transport data between 2 or more request. However they are not good in case you don’t want … Read more

What is an invariant?

An invariant is more “conceptual” than a variable. In general, it’s a property of the program state that is always true. A function or method that ensures that the invariant holds is said to maintain the invariant. For instance, a binary search tree might have the invariant that for every node, the key of the … Read more

What is the difference between a framework and a library?

A library performs specific, well-defined operations. A framework is a skeleton where the application defines the “meat” of the operation by filling out the skeleton. The skeleton still has code to link up the parts but the most important work is done by the application. Examples of libraries: Network protocols, compression, image manipulation, string utilities, regular expression evaluation, math. Operations … Read more

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