HN user

tkot

69 karma
Posts0
Comments56
View on HN
No posts found.

It's less pronounced with diacritics, but enter Unicode normal forms: you can represent š either as š, or s followed by a diacritic. When you want to compare two strings, you have to normalize them to ensure you are comparing apples to apples. I can guarantee most software is broken in that regard. For Cyrillic, it just works.

It's the same with Unicode encoding of Cyrillic letters - й (U+0439) can be written as й (и U+0438 + ◌̆ U+0306)

Interestingly — and not many know this — Unicode includes separate codepoints for all of the digraphs too. While well-intentioned, it only makes the problem worse.

Based on your description it seems that the root cause of the issues is using two letters to represent the digraph - for example N (U+004E) J (U+004A) instead of NJ (U+01CA) - and the sorting issues would be identical if people typed Н (U+041D) Ь (U+042C)instead of Њ (U+040A).

What's the reason for the digraph being substituted by 2 letters in the first case more often than in the second case?

it really is also a tool to best codify spoken language of the Slavs (in a sense, it is trivially provable that Cyrillic script is better adapted even to languages which do not use it today, but have to resort to digraphs or glyphs with diacritics — some are thus not using it to distance from a particular influence instead

I've heard this claim many times but never the reasoning behind it - by what metric is "ш" superior to "š" and so on?

If a search engine (be it Ecosia, Qwant, DDG or Google) is used by someone who is running uBlock Origin, does it benefit the company running the engine or does the cost of queries with no chance of displaying an add to the user outweigh the benefit from the meager amount of data collected (IP address? Interest in given keywords? Some more data for tuning the search results?)?

For example, the German "Ich sehe die Frau mit dem Fernglas" (I see the woman with the binoculars) is _unambiguous_ because "die Frau" and "mit dem Fernglas" match in both gender and case. If this weren't the case, it could be either "I see (the woman with the binoculars)" or "I see (the woman) with [using] the binoculars".

My German is pretty rusty, why exactly is it unambiguous?

I don't see how changing the noun would make a difference. "Ich sehe" followed by any of these: "den Mann mit dem Fernglas", "die Frau mit dem Fernglas", "das Mädchen mit dem Fernglas" sounds equally ambiguous to me.

The noun is not the issue but rather the scope of uniqueness:

Now, given two log files (log file from day 1 and log file from day 2) we want to generate a list of ‘loyal customers’ that meet the criteria of: (a) they came on both days, and (b) they visited at least two unique pages.

It appears to me that the requirement could be interpreted as either:

"(visit on day 1) AND (visit on day 2) AND (total unique pages count > 2)"

a clearer way to put it would be "visited at least two unique pages in total"

or "(visit at least two unique pages on day 1) AND (visit at least two unique pages on day 2)"

a clearer way to put it would be "visited at least two unique pages on each day"

Does visiting pages A and B on day 1 and visiting page A on day 2 also make the sentence true? I think that's the source of ambiguity (or maybe it's ambiguous to me only because English is not my native language).

Yup, it's also very useful for doing stuff like checking archive integrity after upload (got bitten by it once when uploading some archives via FTP) and syncing with cloud - I've had a dedicated client remove files from my PC instead of the cloud after desync, rclone makes it easy to check what will be done and works with pretty much every service available.

in your opinion what is the difference between a Republic and a Democracy?

To keep things simple: democracy -> majority rule

republic -> majority rule + no inheritance of public offices (so no monarch)

Of course it can get more complicated than that - democracies can differ in terms of who can and cannot vote, freedom of press, how exactly the separation of powers is handled (or if the powers are separated at all), what method is used to distribute seats in the parliament, how much power is held by the president and how much is held by the prime minister etc.

By that definition US and UK are both (representative) democracies but of these two only the US is a republic and UK is a parliamentary ("constitutional" sounds pretty weird in this context given that there is no codified constitution) monarchy (while still being a democracy).

Isn't it a matter of words changing meaning over time? Could it be that what James Madison called "democracy" corresponds to "direct democracy" in modern understanding and "republic" corresponds to "representative (indirect) democracy" in modern parlance?

If not, then what are the differences between republic described by Madison and representative democracy?

Improbably Right 3 years ago

I was responding to the person mentioning 100km/h as the correct answer (firstlink).

Improbably Right 3 years ago

I think you are thinking about a case where someone goes 120km/h for 1 hour and then 80km/h for 1 hour instead of going over a fixed distance at 120km/h and then going over the same distance at 80km/h.

It won't work in cases where the stories require images or interaction but for text-based stories I use

curl <pasta url> | html2text | less

Just to be sure ;)

Parsing SQL 4 years ago

Libraries written in SQL. I'm sure one can search for let's say a snippet that will create a date dimension table for a data warehouse and copy it but it's pretty clunky compared to even Python modules.

I'm criticizing SQL as a language which is lacking in composability (as opposed to criticizing relational algebra or relational data model).

Libraries for working with SQL (full-fledged ORMs or simpler query builders) are themselves written in a different language so they don't necessarily prove anything about SQL itself, though one could argue that if people want to use them then they might not be satisfied with raw SQL.

Parsing SQL 4 years ago

I agree regarding SQL views - it's probably the most frequently used way of reusing SQL code.

And even across vastly different domains, even if not directly reusable, SQL queries are still highly transferable.

That's the point, they are probably transferable in the "copy, paste and tweak" sense which would be highly frowned upon in other popular languages.

But which data/processing related tasks is SQL a very poor fit for?

I specifically called SQL "a DSL for data processing", I probably should have written "there are many domains that SQL is a very poor fit for" to be more clear.

In my experience it's much more common to actually see the opposite - inefficient usage of ORMs, exporting datasets only to then perform pre/postprocessing, often requiring building programming "jigs" to circumvent bottlenecks, etc when it could've been done in a more streamlined manner in the DB/warehouse.

Totally agree. Lukas Eder has some nice presentations about it.

Parsing SQL 4 years ago

As much as SQL could be better, it's a very strong local optimum

I mostly agree, though I think that SQL's popularity comes mostly from network effects.

Yeah and what's wrong with that?

Nothing is wrong wrong with that. I just think that it's reasonable to interpret the words "programming in the large" as "being usable as general purpose programming language" (which I admit is not a very strict definition) whereas SQL (or XSLT or awk or bash...) seem well suited for certain niches (important niches nonetheless).

Parsing SQL 4 years ago

It's true though. Relational algebra is a very nice abstraction but SQL as a language is subpar to say the least. SQL is really unergonomic, it's difficult to reuse SQL code which is why there are no SQL libraries worth talking about and it's the reason why people go out of their way to create tools to replace SQL like ORMs or LINQ.

SQL is basically a DSL for data processing just like XSLT for example. Would you call XSLT "designed for large scale programming"?

The "they will not be very productive with it" comment is a bit of a stretch - it can be very productive in the domain it is designed for - but you can often replace SQL at its job (like for example use Dataframe API in Spark instead of SQL API) while there are many tasks that SQL is a very poor fit for.

Proof of my and your existence is impossible in a similar way - we could all be just brains in vats and all external stimuli might be hallucinations (or we could be just GPT-powered chat bots). In fact, I could be a hallucination of yours and you could be my hallucination. While the idea of solipsism is sort of an interesting thought experiment, it doesn't really help explain or predict anything.