Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
orlp
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
181.
▲
by
orlp
2y ago
Please don't.
182.
▲
by
orlp
2y ago
> Every software bug is an example of a computer doing exactly what it was told to do, instead of what we meant. That is only as long as the person describing the behaviour as a bug is aligned with the programmer. Most of the time this i
183.
▲
by
orlp
2y ago
One thing to keep in mind is that keeping the keys sorted on an insert requires O(k) element moves, so an insert is O(log2(n) + k) operations. So if you make k very large your inserts get slower.
184.
▲
by
orlp
2y ago
Ah, the good old chicken and chicken paradox. Which came first, the chicken, or the chicken?
185.
▲
by
orlp
2y ago
Your equation fails to take into account what the original article (before I notified the author, who kindly responded and shouted out my blog without even asking for it) also failed to take into account. When the dice rolls ":|"
186.
▲
by
orlp
2y ago
When I said "Harder for humans, but easy to make a really strong AI for this." I was not referring to the modern meaning of the word 'AI' with GPTs, transformers, neural nets and whatnot, I was referring to the tradition
187.
▲
by
orlp
2y ago
> For example, I can’t imagine working on any performance critical low-level code without a good sampling profiler. I'm pretty happy with https://github.com/mstange/samply . It worked out-of-the-box on Linx and
188.
▲
by
orlp
2y ago
I think you have an error in the equation defining V(s). You have component n_c * V(s) for the 'nothing happened' case, but I don't think that's correct. If you rolled that nothing happens the turn still passes to your o
189.
▲
by
orlp
2y ago
The bootloader is read-only. What the bootloader loads isn't. If the thing you're trying to boot into is faulty, it doesn't matter because you can just replace the thing the bootloader is trying to load. If the bootloader its
190.
▲
by
orlp
2y ago
I think this fails to take into account that your opponent can also roll 'meh', making it your turn again.
191.
▲
by
orlp
2y ago
> Since chance is involved, you will basically never want to do anything but the greediest highest value next action. Sometimes more than half the board has net value of 0 or less which makes them very easy to ignore. Since passing is no
192.
▲
by
orlp
2y ago
If it were just solely :) / :( then it is a freshman's exercise in expectiminimax.
193.
▲
by
orlp
2y ago
The OP mentioned that the AI they programmed is using a simple heuristic.
194.
▲
by
orlp
2y ago
Usually those are for additive/linear systems, the problem with game theoretic graphs like these is that you alternate between max and min nodes, so the system is highly nonlinear.
195.
▲
by
orlp
2y ago
Harder for humans, but easy to make a really strong AI for this. Even overcounting because of illegal board states (multiple winners) and not even bothering to eliminate symmetries, there are at most 2 * 3^9 = 39366 board states. There are
196.
▲
by
orlp
2y ago
This paper goes in way more detail than you'd likely ever want on that topic: https://dl.acm.org/doi/10.1145/3009909 .
197.
▲
by
orlp
2y ago
Ah I looked over it in my skim.
198.
▲
by
orlp
2y ago
Any unbiased algorithm that uses an unbiased coin to shuffle n > 2 elements must be potentially unbounded. Proof: there are n! possible permutations. If the algorithm always finishes within k coin tosses then there are 2^k possible outco
199.
▲
by
orlp
2y ago
I found another in-place approach which also does a higher-base version described here: https://arxiv.org/pdf/2302.03317 , with an open source implementation: https://crates.io/crates/rip_shuffle .
200.
▲
by
orlp
2y ago
Looking into it a bit, it appears that this particular fun fact was first thought of (or at least put to paper) by von Neumann in "Various techniques used in connection with random digits" in 1951. Yuval Peres proves in "Iter
201.
▲
by
orlp
2y ago
Here is a trivial shuffle algorithm that is completely unbiased and only requires an unbiased coin (or random number generator giving bits): 1. Randomly assign each element to list A or list B. 2. Recursively shuffle lists A and B. 3. Conca
202.
▲
by
orlp
2y ago
> Now I'm realizing if we all avoid common names for packages then this whole class of issue goes away. The issue also just goes away if you just do it yourself with pretty much no effort: from sklearn.feature_extraction impor
203.
▲
by
orlp
2y ago
> and treatment could consist of both increasing the space for the brain or decreasing the mass of the brain I'll pass, thanks.
204.
▲
by
orlp
2y ago
> Hopefully we can all agree that LALR parsers are terrible? Yes, I think most of the bad reputation LR(1) gets is from stuff that is actually LALR(1) with its nonsense reduce-reduce conflicts. Another great thing is that LR(1) parser ge
205.
▲
by
orlp
2y ago
Yes, that is the correct answer, although you're missing the 'explanation' part for why this happens :)
206.
▲
by
orlp
2y ago
Yes.
207.
▲
by
orlp
2y ago
> there are things you can parse with a CFG which cannot be parsed with PEG This is not known. It is conjectured to be true because if all context-free languages could be parsed with a PEG grammar it would imply you'd have a linear-
208.
▲
by
orlp
2y ago
> The ordered choice operator should try all choices, not stop earlier. PEGs made this choice to ensure linear-time parsing. Another example of what I would consider a failure is the PEG grammar: Keyword = "else" / &
209.
▲
by
orlp
2y ago
My grammar has no left recursion, there is a terminal string before the recursive nonterminal.
210.
▲
by
orlp
2y ago
> I'd call it a bug. It's not a bug in the tool, it's inherent to PEG. All PEG parsers will behave the same on this grammar. My point is that PEG is highly unintuitive in how it works to most human brains, which is why I s
More ›