HNHacker News
TopNewBestAskShowJobs

Gehinnn

1,104 karma · joined June 2, 2017

twitter: hediet_dev Working at Microsoft on VS Code in Zurich
submissionscomments
Gehinnn··on Merging with diff3: the “three-way merge”
The 3 way merge editor actually shows the branch name!
Gehinnn··on Bog – small, strongly typed, embeddable language
This Syntax has the flaw that autocomplete cannot assist you before the from import clause has been added...
Gehinnn··on Merging with diff3: the “three-way merge”
The new 3 way merge editor in VS Code tries to load the documents for base, yours and theirs from the corresponding commit URI, so that extensions such as gitlens can show the line history for each document - they don't even have to know about the merge editor. (disclaimer - I work on VS Code and its 3 way merge editor)
Gehinnn··on “P = NP” Polynomial-Sized LP Models for Hard Cops
You can also mix problems to change the average complexity. Take SAT (in NPC) and encode each instance with a word over a binary alphabet. Then add 2SAT (in POLY) and encode it using an alphabet with four letters. If you chose a random instance of length n, the probability it is from SAT is less than 1/2^n.

Still, this problem is NP complete, as it is in NP and you can trivially reduce SAT to it.

Gehinnn··on Rice’s Theorem: An interactive tutorial
"If halt can be implemented by using .length that means you can reduce .length to halt."

This is true. The condition is false (halt cannot be implemented by using length), thus the implication is true, regardless of the implicant.

Gehinnn··on Rice’s Theorem: An interactive tutorial
Why would this distinction matter for the argument?
Gehinnn··on Rice’s Theorem: An interactive tutorial
Your reasoning is valid, and I do have the impression that you should refresh your knowledge about logic.
Gehinnn··on Rice’s Theorem: An interactive tutorial
If you assume that halt does exist to make your solution valid, then you can derive any statement (including that addition does not exist), because that assumption is false.

In general: Let P be a statement. Lets assume that the Turing Machine T solves the halting problem - let's call this assumption H.

Now we assume P is false. Now we have a contradiction - H says that T solves the halting problem, but we know that there is not Turing machine that can solve the halting problem! Thus P must be true!

Notice that P is arbitrary.

Plainly speaking: If you assume that the halting problem can be solved, I can formally prove you that addition does not exist (i.e. there is no operation +, such that it forms a group on Z)

> By the logic (as written) of the article the implication is that '+' does not exist.

This is actually true. With that strong assumption, + does not exist.

Gehinnn··on Rice’s Theorem: An interactive tutorial
This is not false.

If you can implement halt using addition, addition cannot exist.

Ex falso quod libet - if you can prove a single false statement, every statement is true.

Gehinnn··on Always use [closed, open) intervals
Don't call you integer bound vars `start` and `end` please. Either use `start` and `endExclusive` or start and length - this greatly reduces confusion.

In my experience, half opened integer intervals lead to fewer `- 1` in the code.

Gehinnn··on Visualizing Diffs: The Myers difference algorithm (2020)
It is a very interesting idea to decompose a diff into two diffs - one part that a computer understands (like renames, formatting changes), and one part that a computer does not understand, but that is as small as possible!

The referenced issue is only one example. There are many more (e.g. https://github.com/microsoft/vscode/issues/164574).

Gehinnn··on Visualizing Diffs: The Myers difference algorithm (2020)
In case of the diff viewer in VS Code, the goal is to present the changes to the user in a helpful way, so that the user quickly understands what changed.

In case of the merge editor, the diffs should reflect the actual edits as close as possible, so that non-conflicting edits cause non-conflicting diffs, which then allows a non-conflicting merge.

Gehinnn··on Visualizing Diffs: The Myers difference algorithm (2020)
I just worked on a new diff algorithm for VS Code, in particular for the new merge editor (you can turn it on with "diffEditor.diffAlgorithm": "experimental").

Diffing is hard and there are many subtleties (e.g. https://github.com/microsoft/vscode/issues/164370).

The space efficient Myers diff algorithm has some problems when using it for merging, as tiny changes at the beginning of a file can cause a different path selection later on. Also, Myers doesn't minimize the number of hunks (only their total length), which sometimes leads to unnatural outcomes.

If anybody has good ideas for more advanced diffing algorithms, I'm all ears! (maybe even tree based ones, like difftastic) It's already very difficult to objectively evaluate the quality of a diff or to see if improving the diff for a special case doesn't make the average case worse.

As for the visualization of Myers, I can recommend to have a look at https://blog.robertelder.org/diff-algorithm/.

Gehinnn··on How Mathematics Changed Me
> [...] mathematics can lead one to the conclusion that behind the veil of life there is a structure and an order.

Rule 30, the collatz conjecture and the monster group let me to the conclusion that even math is chaotic.

Gehinnn··on Difftastic, the fantastic diff
Is there an existing open source effort to recreate that tool?

Are the algorithms open? Does the tool work reliably?

I find it very sad that potentially revolutionary progress is lost like this...

Gehinnn··on Difftastic, the fantastic diff
Semantic merge is no longer available? :(
Gehinnn··on Difftastic, the fantastic diff
It would be so cool if there was a json output, so that other tools (eg VS Code) can use this diffing algorithm! Thanks for explaining the algorithm!
Gehinnn··on Computers and Intractability: A Guide to Algorithmic Lower Bounds
I find this thought funny: The faster the reduction, the stronger the lower bound.

When you reduce all-pair-shortest-paths (assuming a cubic lower bound) to your problem in quadratic time, your problem has a lower bound of linear time. However, when you speed up the reduction to linear time, your lower bound is quadratic time!

This also applies to simulations of TMs. The faster the simulation, the sharper the complexity classes.

Thus, by making something faster, you can show that something else cannot be made faster anymore.

(Afaik this also applies to P vs NP: Find a fast enough algorithm to reduce an arbitrary problem in EXP to NP and you showed that P!=NP)

Gehinnn··on Show HN: Reduce SQLite database size by up to 80% with transparent compression
But it uses a shared zstd dictionary among rows!

The details are described here: https://phiresky.github.io/blog/2022/sqlite-zstd/

Gehinnn··on Ask HN: What are some cool but obscure data structures you know about?
Finger trees. They work on an arbitrary monoid and maintain a list of items. You can insert and remove items in logarithmic time, as well as ask for the sum of items in a given range, also in logarithmic time.

This is useful for example when you want to convert between offsets and line/column numbers efficiently, while you also want to efficiently update/insert/replace lines.

Gehinnn··on Magnus Carlsen to give up World Championship title
White could win without zugzwang! Because white starts. After the first move, the position is no longer symmetric, so it doesn't help black to skip to switch sides.
Gehinnn··on Magnus Carlsen to give up World Championship title
Well, applying "zugzwang" means you only win because the opponent has to do a move and cannot skip their turn.

When black has a winning strategy, black already applies "zugzwang" for white's very first move: Black only wins because white has to make a move. If white could skip, black would not win.

> Edit: it may be that the statement "without Zugzwang" implicitly (or perhaps by definition) means you are allowed to skip moves?

Yes. It's not well defined, but I'd say a non-zugzwang win is a win (or rather a winning position) where you would also win when your opponent can skip their turn. A zugzwang win is a win that is not a non-zugzwang win.

Gehinnn··on Magnus Carlsen to give up World Championship title
The question was if there is any other scenario where black could force a win other than by forcing a zugzwang.

I would say no by contradiction. Let's assume black could win without zugzwang. Then white would win (and in particular not lose) by skipping the very first move and then playing blacks strategy (because now black has to make the first move and by white skipping the first move, the colors swapped).

If white would not skip the very first move and play an arbitrary move instead, white loses and black wins.

But this is the very definition of zugzwang! Thus, black can only win because of white's initial zugzwang, which contradicts our assumption.

Gehinnn··on Magnus Carlsen to give up World Championship title
Zugzwang is the only way for white to lose. Without Zugzwang and a winning strategy for black for chess with Zugzwang, white could skip the first move and now has the winning strategy.
Gehinnn··on Magnus Carlsen to give up World Championship title
Why is that the consensus guess? I could imagine that a perfect play completely contradicts common chess theory.

Just like we can efficiently find approximate solutions for the traveling salesman problem (that are at most 50% longer than the optimal solution), these heuristics have not much to do with the optimal solution.

Gehinnn··on Extreme explorations of TypeScript's type system
That's not the meaning of turing completeness, just an implication of the space hierarchy theorems. There are systems that also have branching and unbounded memory, but are not turing complete. Context free grammars for example.

Turing completeness means for TS that for every computable function, there is a TS type that can compute that function (if TS wouldn't limit the recursion depth).

Gehinnn··on Two envelopes problem
The mistake is in step 7.

You cannot calculate the expected value (of the envelope you get, when you pick one randomly and then swap) like that, as A is not a constant and actually depends on if you took the less or more valuable envelope initially.

If you use A1=X in case you took the less valuable envelope initially and A2=2X in the other case, the expected value is (1/2)*(2*A1) + (1/2)*(A2/2) = 1.5X

and if you don't swap, you get: (1/2)*A1 + (1/2)*A2 = 1.5X

... which makes sense.

If you change the experiment so that the value of the second envelope does not depend on the first one (if you first chose and only then the value of the other envelope is randomly either double or half), A is constant and you actually should swap.

Gehinnn··on Understanding Zero-knowledge proofs through illustrated examples
We still don't know if the universe allows us to do that. If P=NP ZKPs are worthless.
Gehinnn··on Accepted and ghosted: interviewing for a leadership position at Stripe
Even though I did not accept Datadogs offer, I can only confirm this - my interview experience at Datadog for a software engineer position was truly amazing. I could feel they care.
Gehinnn··on SoME1 results
I don't think winning the contest should be the primary motivation for making such a high quality education video.
← PreviousPage 3 of 11Next →