76 karma · joined Apr 28, 2020 (6y ago) · 26 submissions
comment 3mo ago · link · parent
It would kill the economy overnight.
comment 3mo ago · link · parent
comment 8mo ago · link · parent
public int parseOrDefault(String value, int defaultValue) {
if (value == null || value.isBlank()) return defaultValue;
for (int i = 0; i < value.length(); i++) {
char c = value.charAt(i);
if (i == 0 && c == '-') continue;
if (!Character.isDigit(c)) return defaultValue;
}
return Integer.parseInt(value);
}
Is probably worse than Integer.parseInt alone, since it can still throw NumberFormatExceptions for values that overflow (which is no longer handled!). Would maybe fix that. Unfortunately this is a major flaw in the Java standard library; parsing numbers shouldn't throw expensive exceptions.comment 1y ago · link · parent
comment 1y ago · link · parent
You’ve got a monopoly on lemonade because you pay all the grocery stores to be the default lemonade.
So we’re going to force you sell your car.
I don't think this is an accurate anaology. It's more like, you own the vast majority of grocery stores, and you make lemonade, and you force all the other grocery stores to only sell your lemonade.To put it another way, the problem is not so much that Google shouldn't be paying to be the default search engine, but that it shouldn't own both the browser and the search engine.
I think this harkens back to the anti-trust court case, United States v. Paramount Pictures, where the court ruled that the film studios cannot hold monopolies over the movie theatres, and that theatres must remain independent.
Similarly, browsers and search engines being independent is good for competition because the internet is too important to let a single company dictate how it is used.
comment 1y ago · link · parent
Unfortunately not:
Using notifyAll and wait in Java is tricky to do correctly, you'd have a much easier chance using concurrency primitives that wrap these functions, like CountDownLatch[1] for one offs, or Condition[2].
System.currentTimeMillis is also not guaranteed to be monotonic, and System.nanoTime should be used instead. This would of course be obviated if a better concurrency primitive were to be used.
[1] https://docs.oracle.com/en/java/javase/21/docs/api/java.base...
[2] https://docs.oracle.com/en/java/javase/21/docs/api/java.base...
comment 1y ago · link · parent
comment 2y ago · link · parent
Even if you contact them, GitHub says[1] that they will not remove "non-sensitive data", but makes no reference to copyrighted material.
[1] https://docs.github.com/en/authentication/keeping-your-accou...
comment 3y ago · link · parent
comment 4y ago · link · parent
The stuff you will need most is in Volume 3.
comment 4y ago · link · parent
comment 5y ago · link · parent
If you earn £21,000 and the threshold is £20,000, you only pay back a portion of £1,000, not all of the £21,000.