What's your opinion on using UUIDs as database row identifiers, particularly in web apps?

I've always preferred to use long integers as primary keys in databases, for simplicity and (assumed) speed. But when using a REST or Rails-like URL scheme for object instances, I'd then end up...

What's the best practice for primary keys in tables?

When designing tables, I've developed a habit of having one column that is unique and that I make the primary key. This is achieved in three ways depending on requirements: Identity integer...

How can I iterate through the unicode codepoints of a Java String?

So I know about String#codePointAt(int), but it's indexed by the char offset, not by the codepoint offset. I'm thinking about trying something like: using String#charAt(int) to get the char at an...

What is internal representation of string in Python 3.x

In Python 3.x, a string consists of items of Unicode ordinal. (See the quotation from the language reference below.) What is the internal representation of Unicode string? Is it UTF-16? The items...

What is a "surrogate pair" in Java?

I was reading the documentation for StringBuffer, in particular the reverse() method. That documentation mentions something about surrogate pairs. What is a surrogate pair in this context? And...

Unicode test strings for unit tests

I need some Utf32 test strings to exercise some cross platform string manipulation code. I'd like a suite of test strings that exercise the utf32 <-> utf16 <-> utf8 encodings to validate that...

How to call a parent method from child class in javascript?

I've spent the last couple of hours trying to find a solution to my problem but it seems to be hopeless. Basically I need to know how to call a parent method from a child class. All the stuff that...

Java 8: Mandatory checked exceptions handling in lambda expressions. Why mandatory, not optional?

I'm playing with the new lambda features in Java 8, and found that the practices offered by Java 8 are really useful. However, I'm wondering is there a good way to make a work-around for the...

Detecting if a character in a String is an emoticon (using Android)

Like the title says. I want to find out if a given java String contains an emoticon. I can't use Character.UnicodeBlock.of(char) == Character.UnicodeBlock.EMOTICONS since that requires API level...

Difference between composite characters and surrogate pairs

In Unicode what is the difference between composite characters and surrogate pairs? To me they sound like similar things - two characters to represent one character. What differentiates these two...

DataTable.Load shows less rows than source DataReader

I have just noticed a strange behaviour in my ASP.NET application running both on MySQL and SQL Server. The application issues plain SQL queries over an EF connection to build a dataset. The...

Why does SQL standard allow duplicate rows?

One of the core rules for the relational model is the required uniqueness for tuples (rows): Every individual scalar value in the database must be logically addressable by specifying the name of...

How do I read characters in a string as their UTF-32 decimal values?

I have, for example, this Unicode string, which consists of the Cyclone and the Japanese Castle defined in C# and .NET, which uses UTF-16 for its CLR string encoding: var value = "🌀🏯"; If...

Javascript Find Emoji in String and Parse

After TONS of research, I have found how to parse emoji in realtime using the Twemoji library. Now, I need to figure out how to identify if there's emoji within some text, grab the position of...

Python prettytable Sort by Multiple Columns

I'm using PrettyTable to print data to the terminal in a nice table format. It's pretty easy to print it ordered by a single column. from prettytable import PrettyTable table =...

How can I convert JSON-encoded data that contains Unicode surrogate pairs to string?

so I am trying to take this data that uses unicode indicators and make it print with emojis. It is currently in a txt. file but I will write to an excel file later. So anyways I am getting an...

How can I convert surrogate pairs to normal string in Python?

This is a follow-up to https://stackoverflow.com/questions/38106422/converting-to-emoji. In that question, the OP had a json.dumps()-encoded file with an emoji represented as a surrogate pair -...

Is it possible to use two different versions of OpenSSL libraries in same application?

I know this is a very long explanation but I'm trying to explain everything without having to answer a lot of questions later or get spurious answers. There is an application that uses an old...

PyCharm thinks this RegExp has Duplicate character is characte class. Is it bug or not?

# Python3 r = re.compile(r"[\U0001f570\U0001f573\U0001f57a]") This RegExp should find one of three emoji. Everything works correct, but PyCharm says: "Duplicate character \U0001f573 inside...

Detecting *all* emojis

Right now I'm using this piece of code : public static bool ContainsEmoji(this string text) { Regex rgx = new Regex(@"\p{Cs}"); return rgx.IsMatch(text); } And it's being somewhat...

Convert &#55357; &#56911; to Emoji in HTML using PHP

We have a bunch of surrogate pair (or 2-byte utf8?) characters such as &#55357;&#56911; which is the prayer hands emojis stored as UTF8 as 2 characters. When rendered in a browser this string...

How surrogate keys are handles in hive

I know that hive cannot create surrogate keys or is rather difficult. I want to understand how companies have implemented dimensional modeling in their warehouse. One way I can think of is leaving...

Why does inserting a row with a foreign key referencing a row by pk modified in another snapshot isolation transaction cause the transaction to hang?

I ran into an interesting problem in a system where due to a schema change, a first database transaction in a single thread blocks a second database transaction from completing, until a timeout...

function node to upload file to ipfs and to return the file hash

I have not much idea about JavaScript but I really like the Node-Red framework to connect to IoT devices. I've built a small flow that connects an http-request node (to get a picture) to a...

Collisions when using FARM_FINGERPRINT in BigQuery to generate hashes for Surrogate Keys

I was wondering if anyone is able to provide some insight into the chances of collisions when using FARM_FINGERPRINT in BigQuery to generate INT64 hashes to be used as Surrogate Keys on...

How to get the precise surrogate key for the incomming fact records

I am building a data warehouse for my company. Recently, I just realized that there are some holes (potentially very dangerous) in my SCD type 2 dimension implementation, so that I have to review...

For the deidentify_with_fpe() Python API wrapper for google DLP what are the arguments needed to pass through?

I am working through the google cloud dlp api documentation available here specifically this question is about deidentify_with_fpe(). My question is what is the format of the arguments needing the...

ImportError: cannot import name '...' from partially initialized module '...' (most likely due to a circular import)

I'm upgrading an application from Django 1.11.25 (Python 2.6) to Django 3.1.3 (Python 3.8.5) and, when I run manage.py makemigrations, I receive this messasge: File...

Multiple Set-Cookie headers ignored by API Gateway in combination with Lambda integration and CloudFront

My setup looks like this: |––––––––––––| |–––––––––––––| |–––––––––––––––––| | |...

Python3 f.write UnicodeEncodeError: 'utf-8' codec can't encode characters surrogates not allowed

Run Python files over the web (php). Afterwards, an error occurs while printing the Korean string to a file with Python. On the other hand, running Python files directly using the terminal does...