131 karma · joined Feb 12, 2019 (7y ago) · 32 submissions
comment 7mo ago · link · parent
comment 2y ago · link · parent
I don't think that's true. The following CFG is unambiguous:
S ::= A S | A
A ::= 'a' | 'a' 'b'
Yet if we translate this 1-to-1 to a PEG (without changing the order of the alternatives), it's not going to match any input with 'b's in it, so it doesn't match the same language.comment 2y ago · link · parent
Citation needed. I'd be quite surprised if it were common for servers of professional games to trust the client in that sense (i.e. allowing it to decide game logic like what gets spawned where).
As far as I'm aware the most common types of multiplayer cheats are
* wall hacks, which you could probably prevent by not sending the client any information about objects that the player can't see, but that would require the server to calculate the line of sight for every player/object, * and aim bots, which I don't think you could prevent at all on the server side since they don't rely on the bot having access to any information that the player isn't supposed to have. They just rely on the bot being better at aiming. I suppose if you did all rendering server side and only sent the rendered graphics to the client (i.e. streaming), that would make it harder for the bot because it'd now have to do image recognition to find the target, but that just makes it harder, not impossible. Plus, game streaming wasn't well received for a reason and anyway, I don't think that's what you had in mind when you talked about "not trusting the client".
comment 3y ago · link · parent
There are certain fearures that are harder or impossible to implement with RE2's approach, but it's not true that it doesn't support the kind of regex that would catastrophically backtrack using a backtracking engine.
`(.*a)*b` would be a (silly) example of a regex that can catastrophically backtrack using backtracking engines and re2 supports it just fine without backtracking.
comment 3y ago · link · parent
For games on Steam and movies basically anywhere, the current system is that after I buy the game/movie, I can watch/play it for as long as I have access to the account. If I lose the account or the service shuts down, I'm fucked. That sucks.
For games on GOG or MP3s basically anywhere, the current system is that I buy it and then I can play the game/music forever as long as I don't lose the downloaded files. If I do lose the files, I can still redownload them as long as the service is still operating and I still have access to the account.
The second system seems fine to me.
comment 3y ago · link · parent
> They really ought to stop using "buy"/"purchase" metaphorically to mean something more like "one time fee for an indefinite lease that ends upon account termination."
That doesn't really apply to buying music though, does it? If Amazon banned my account, that wouldn't prevent me from listening to the MP3s I've bought from them. It would only prevent me from re-downloading them from their servers if I somehow lost all of my local copies.
But if I buy a CD from a physical store, they also don't give a me another copy for free if I lose it (even without account termination entering into it), so I'm not really any worse off with the digital download.
comment 4y ago · link · parent
There's nothing about the signature of an ordinary binary search method that would imply that it only works for arrays that have less than MAX_INT/2 elements.
comment 5y ago · link · parent
As in: there are still (older) projects around that haven't (yet) migrated away from Ant? Sure.
As in: Ant is still the go-to build system or at least still commonly used? No, not at all. When I create a new Java project in IntelliJ for example, I can choose between Maven and Gradle as the build system. Ant isn't even offered as an option.
comment 5y ago · link · parent
Note that this isn't specific to the REPL. Running `print(exit)` in a Python script will print the same message.
comment 5y ago · link · parent
Do you have reason to believe that the accidental part matters to any significant degree?
I mean, C++ compilers are notorious for being slow and most of them are written in C++, which is one of the fastest languages around. It seems to me that, if your language is conceptually slow to compile, the fastest implementation language in the world won't fix that problem for you.
On the other hand, if your language is conceptually fast to compile, a slowish implementation language won't hurt much (I've never heard any complaints about the speed of `javac` for example though I've heard plenty of complaints about the speed of Java in general).
comment 5y ago · link · parent
That seems pretty antagonistic for no reason.
> You parent comment basically says the very same thing
How so? The original comment said that a lack of information hurts nerds' feelings because having information is a matter of pride for them (so for emotional reasons, not rational ones). Your parent said they need information to make a well-informed decision, not for emotional reasons. How is that the same thing?
comment 5y ago · link · parent
comment 5y ago · link · parent
I also wouldn't say that German has "otherwise the same grammar as English". (Or in wrong German: "Ich auch würde nicht sagen dass Deutsch hat ansonsten das gleich Grammatik wie Englisch" - even if we're just talking about comma rules, the German version should have a comma before the "that/dass").
[1]: http://www.neue-rechtschreibung.net/2012/04/30/kommasetzung-...
comment 5y ago · link · parent
That's solved easily enough by evaluating the expression in the scope where it was defined (again that's what other languages do).
> Also, I'm rather sure that's how it works in C++
Default arguments in C++ work as I described: If you define `void f(int arg = g(x)) {}`, then calling `f()` n times will call `g` n times as well (using the `x` that was in scope when `f` was defined) - and if you never call `f`, `g` isn't called either.
An example demonstrating this: https://ideone.com/vs26Oq
comment 5y ago · link · parent
Why would it need to copy anything? What's wrong with just evaluating the default argument expression every time the function is called with a default argument rather than once at definition-time? That's how it works in other languages.
comment 5y ago · link · parent
If we look at the coalitions that have happened at the national level in this century, we have:
* Social Democrats + Greens
* Conservatives + Social Democrats (like, a lot)
* Conservatives + Liberals
So that's three different coalitions that have actually happened in the last 20 years. Admittedly three is not a lot more than two, but it is more (and we're talking about a time frame that only includes 5 national elections and only about actual coalitions, not potentially viable ones).
And if you look at state governments as well, there are actually a lot more combinations that seem to work.
> Will the German Greens ever get a Cabinet seat outside a coalition with the Social Democrats?
Almost certainly.
At the state level they already have. In one case they're even the majority with the conservatives being the minority partner in the coalition.
At the national level they almost did in 2017. Negotiations between the conservatives, the greens and the liberals failed because the liberals backed out and the greens + conservatives didn't have a majority on their own - they would have been ready to go otherwise. It is entirely possible, even likely, that we will see a conservative-green coalition after this year's elections.
comment 6y ago · link · parent
I mean, I don't doubt that C++ is in fact faster than Haskell, just not by that much.
comment 6y ago · link · parent
wk_end was talking about "functional pseudo-quicksort" on immutable linked lists. You're presumably talking about a proper quicksort on mutable arrays. That's comparing apples to oranges.
And even if you weren't, how is that an argument? Person A says "X is faster than Y", then person B says "Actually I just ran X and it took 10x longer than Y" and then you say "Well Z, which isn't even part of this discussion, is 1000x faster than both X and Y, so your argument is invalid". How does that follow?