Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
slaymaker1907
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
91.
▲
by
slaymaker1907
2y ago
Yes, you’ll get the alternating pile phenomenon more and more often. In reality, big “clumps” of cards from one pile or the other actually improve the randomization. In the extreme, this becomes the Faro shuffle https://en.m.wiki
92.
▲
by
slaymaker1907
2y ago
I wish the 7 shuffle thing would stop getting repeated everywhere. It’s based off a faulty model, particularly for sleeved cards, since if we consider the deck as two piles left (L) and right (R), Pr[L|R] (the probability of taking from the
93.
▲
by
slaymaker1907
2y ago
Can we just dissolve the U.S. District Court for the Northern District of Texas? They continually harm the entire country with their nonsense. Almost every “crazy” decision you’ve heard about in recent years comes from this one district.
94.
▲
by
slaymaker1907
2y ago
You can sort of do it so long as the return type is a template parameter. template<typename T> T my_construct() { T result; return result; }
95.
▲
by
slaymaker1907
2y ago
40MB seems like a weird requirement. If it’s under 1GB, I don’t think most people really care any more about executable size. Memory usage is still relevant, but 1GB is going to be less than 1% of disk usage for almost everyone.
96.
▲
by
slaymaker1907
2y ago
I’ve come around to the idea that checksumming isn’t some universal panacea. Once you have checksums, you need to start thinking about error *recovery* and not just detection. What happens to linked data? Do you just declare the whole SQLit
97.
▲
by
slaymaker1907
2y ago
B-trees are definitely more useful, but I don’t think they’re really a good idea to start out with as your first balanced tree.
98.
▲
by
slaymaker1907
2y ago
I don't think so since you need to leave edit mode to terminate the macro.
99.
▲
by
slaymaker1907
2y ago
You can surprisingly sort of do this in Java. Just create a lambda which will start the game at the current state when you call it.
100.
▲
by
slaymaker1907
2y ago
Depending on how large your save state is, it could be as simple as a function mapping from a list of game objects to the saveable object. That approach works really well with Redux on the web since you really don't want to save most t
101.
▲
by
slaymaker1907
2y ago
Yes, and the trouble I've seen is that MTG players assume they aren't shuffling like a pro card dealer when their shuffles are actually even more uniform. IIRC Diaconis' original study even mentioned that the number of requir
102.
▲
by
slaymaker1907
2y ago
I think we really need to consider the efficiency of the shuffle as well when evaluating a shuffling technique. If it takes hundreds (much less tens of thousands) of lengthy steps to shuffle the deck, then no one is going to do it. Addition
103.
▲
by
slaymaker1907
2y ago
The bias I saw would likely be difficult to exploit without studying the mathematics a lot more. It seems to pass several statistical tests, but the problem I found was more about independence. Let's call the two splits L for left and
104.
▲
by
slaymaker1907
2y ago
It kind of makes me mad that the very simple RS algorithm (divide and conquer) isn't more widely known given that it's so easy to implement and that it's actually parallelizable unlike Fisher-Yates. I think it's also bet
105.
▲
by
slaymaker1907
2y ago
You need at least nlog(n) bits for the same reason as regular shuffling. There are n! permutations and it therefore takes log(n!) bits to uniquely describe a shuffle. nlog(n) is the same as log(n^n) which is obviously greater than log(n!) (
106.
▲
by
slaymaker1907
2y ago
I implemented this for GPUs back in college and you’re right, it’s really good for parallelism. This shuffle is also great if you want to do a completely unbiased shuffle with real cards. Fischer-Yates is impractical to do with a real deck
107.
▲
by
slaymaker1907
2y ago
It’s almost certainly still good enough since it’s unlikely to be biased in ways that matter. Most hand shuffling methods have nasty biases as well. For standard riffle shuffling, there is often a bias in pulling from the pile opposite from
108.
▲
by
slaymaker1907
2y ago
I love that they used a clipart wizard hat as the *official* symbol of software development on page 14.
109.
▲
by
slaymaker1907
2y ago
Oh my god, these would be absolutely amazing as someone with auditory processing issues.
110.
▲
by
slaymaker1907
2y ago
I think wasm would work pretty well given that sandboxing is essential for browser security. However, the hard part is having a functional permissions system that isn’t so strict that actually malicious plugins can slip through due to every
111.
▲
by
slaymaker1907
2y ago
There was an interesting paper I read the other day about a scheme for guaranteed constant time dynamic allocation and deallocation. The idea was you make all objects identical in size (they used 32 bytes). Then, on deallocation of a 32 byt
112.
▲
by
slaymaker1907
2y ago
There are pretty good reasons to do that. We've been really lax in what is allowed to run as root/admin when in reality, those permissions should only be used when doing things like reading the MFT or snooping on all the network t
113.
▲
by
slaymaker1907
2y ago
You're assuming that network latencies follow the triangle inequality, i.e., that A->C is smaller than A->B + B->C. However, that breaks down because of money. It's possible that the user's ISP is a cheapskate withou
114.
▲
by
slaymaker1907
2y ago
C++ also supports this. However, you still end up needing to do a bunch of operations, the compiler just hides it from you which is why I think Chen opted not to use it. struct my_bitfield { uint16_t b:5; uint16_t g:6; uin
115.
▲
by
slaymaker1907
2y ago
You can reduce the branches by just eliminating the early return returns. And short circuits, but you can use bitwise and instead to encourage the compiler not to generate extra branches (the compiler is generally free to do this anyway as
116.
▲
by
slaymaker1907
2y ago
I'd argue it barely works in C++ as well. I've seen so many poorly implemented classes that violate the very complicated 3/5/0 rule. It's much easier to do RAII correctly in Rust since people aren't constantly
117.
▲
by
slaymaker1907
2y ago
Biden technically has authority to invade the Netherlands if they arrest any member of the military or government of Israel under the American Service-Members' Protection Act since Israel is a major non-NATO ally.
118.
▲
by
slaymaker1907
2y ago
I think I agree on that, but returning null seems like a bad idea in this specific instance. Instead, I think I'd prefer they return an object like a promise so people are forced to check if an error occurred.
119.
▲
by
slaymaker1907
2y ago
You're assuming that error handling logic should be local, but I don't think that's ideal. Most of the time, I really do just want things to bail out if something goes really wrong and log what happened. This is because what
120.
▲
by
slaymaker1907
2y ago
You can sort of work around it by placement new, but it’s still hugely inconvenient in the general case since the thing could have strict alignment requirements. Oh and not just stack, it also breaks global variables because destructors oft
More ›