PostgreSQL: create database with UTF8 encoding same as in MySQL (including character set, encoding, and lc_type)

Yes, you can be more specific. For example: CREATE DATABASE “scratch” WITH OWNER “postgres” ENCODING ‘UTF8’ LC_COLLATE = ‘en_US.UTF-8’ LC_CTYPE = ‘en_US.UTF-8’; Also I recommend to read the following pages about locales and collations in PostgreSQL: http://www.postgresql.org/docs/current/interactive/locale.html http://www.postgresql.org/docs/current/interactive/collation.html

Down angled quote (« and ») in HTML [duplicate]

The short answer to your question is “No, there aren’t.” &laquo and &raquo are not actually intended as direction arrows, despite their frequent usage as such. What they are actually intended for is hinted at by their entity names — they’re supposed to be “angled quotes”. Certain European countries (notably France) tend to use these … Read more

Obscure / encrypt an order number as another number: symmetrical, “random” appearance?

Pick a 8 or 9 digit number at random, say 839712541. Then, take your order number’s binary representation (for this example, I’m not using 2’s complement), pad it out to the same number of bits (30), reverse it, and xor the flipped order number and the magic number. For example: 1 = 000000000000000000000000000001 Flip = … Read more

Are all JSON objects also valid JavaScript objects?

Update 2019: the answer is now YES as of this proposal and JavaScript versions following ECMAScript 2019 (including) will be proper supersets. TL;DR The answer is “no”. There are cases when JSON object won’t be valid for JavaScript. JSON is NOT a JavaScript subset. “Little” difference JSON That is: due to JSON specification, you can … Read more