char* can also be a C-style string. std::byte has the same special treatment in the standard as char and unsigned char, with the added benefit of not being used for other purposes (i.e. ASCII character or uint8, respectively).
HN user
s28l
C style cast can be either a static_cast or reinterpret_cast, but it can also be a const_cast or a static+const or reinterpret+const. Finally, it will perform a static_cast that bypasses private inheritance (because the alternative would be to fall back to a reinterpret_cast, which is wrong if the static_cast needs to apply an offset to the pointer)
I find this article rather underwhelming because it spends so much time calling out bad examples and so little time highlighting examples of subtlety (in any era). Without positive examples, I don’t think they make the case that this is a new phenomenon or even a phenomenon at all: all the author has done is identify a lens to criticize through.
It may be the case that this is a recent phenomenon (though some other commentators disagree), but without providing detail on what movies the author feels avoid this pattern, they make their argument impossible to refute or engage with. (It also insulates the author’s tastes from criticism, which I suspect is part of the motivation)
Maybe it's a combination of the "bend" and the "long slow" part.
If you are making a turn the centrifugal force will push the fluid away from the axis of rotation. There is likely a level sensor only on one side of the tank, so the turn might push the fluid away from the sensor enough to trigger a warning.
The sensor likely has a time component to avoid triggering every time you make a turn, but if this bend is long enough, maybe the fluid is displaced long enough that it overcomes that minimum time.
Doesn't the unrolled version skip the speculation for three out of every four entries? If so, it seems suspicious that it does so much better when it looks like it's a mix between the first and second version instead of just an unrolled implementation of the second version.
I'd also be interested in seeing how this performs when the data isn't allocated in one chunk (which seems to be the absolute best case scenario for this trick). Will it end up worse than the "naive" version due to all the branch mispredictions?
His goal seems to be to effect change. My understanding is that before reaching these questions, he _was_ interested in the job. Explaining to a potential employer that they lost a candidate's interest because of their application questions seems like something they would want to know.
Considering he also wrote a blog post criticizing this question, I feel comfortable saying that he already passed on this job. So saying you'd pass on him has "you can't quit, you're fired!" energy to it. Also, I don't agree that this demonstrates insubordination. There can't be insubordination without a subordinate-supervisor relationship.
I also don't think this is a "smartass" answer:
This is an irrelevant question unless you're focusing on recent grads with no job history.
That is a straightforward statement of his opinion. He's perfectly within his rights not to answer any question, and explaining why he chooses not to is hardly an unreasonable thing to do.
Also, you can short crypto on CME. Is that rigged too?
I think your first point is fair, but I think you're overselling things here. Yyou can only short Bitcoin, not all crypto, but the real issue is that the Bitcoin futures curve is in backwardation, which implies a certain financing cost to go short.
The settlements for the various contracts can be found here[0]. Nearly all of the volume is concentrated in the front month contract (Jan 23 at the moment), so if you want to be able to trade any size at all, you'll have to do so by selling that contract.
However, the issue is that the future price is consistently lower than the spot price. So if you bought a Bitcoin today and then sold a future for the front month (i.e. so you locked in the price you could sell the Bitcoin at in the future), you would be guaranteed to lose money.
And you will effectively have to do exactly that every month: as your short contract approaches expiry, you'll need to roll it over for the next month's contract. As the front month gets closer to expiry, its price will trend to the Bitcoin spot price, meaning you'll have to buy it back at a higher price then you will get when you sell the next month contract.
I don't have access to the historical settlement prices for the CME contracts at the moment, so I can't estimate the exact roll cost you'd pay over the course of a year. If we guess that it's about $100 each roll, then you'd pay $1200 over the course of the year per bitcoin (as well as having to commit 50% of the price of bitcoin in margin).
The OP posted 185 USDC net as collateral and has a short position of 450 USDT, which he's paying about 13% on. In the CME case, the collateral requirements are higher (50% of the notional shorted) but the financing cost is lower (less than 10% of notional shorted).
[0] https://www.cmegroup.com/markets/cryptocurrencies/bitcoin/bi...
There is a big difference between "undefined" and "unspecified" behavior. In this case, the behavior of `unique_ptr(unique_ptr&&)` is in fact specified. [0]
However, the bigger issue with that code is that it can easily stop working with a simple refactor. Consider:
void foo(std::unique_ptr<int> ptr) {}
void bar(std::unique_ptr<int>&& ptr) {}
int main()
{
std::unique_ptr<int> p1{new int{1}};
std::unique_ptr<int> p2{new int{2}};
foo(std::move(p1));
assert(p1 == nullptr);
bar(std::move(p2));
assert(p2 != nullptr);
}
Neither of the above asserts will fire, but from the calling site, they look exactly the same. In my opinion, the more explicit option would be to do something like `bar(std::exchange(p2, nullptr))`[0]: overload (5) https://en.cppreference.com/w/cpp/memory/unique_ptr/unique_p...
Against better judgement (and advice of counsel, presumably), this guy is still running his mouth to the media. If you had a disgraced former crypto CEO who was still willing to speak at your finance conference, wouldn't you keep him on the docket? I certainly would.
No, just no. Why is the MSM putting out constant puff pieces about this guy?
Just to be clear, this is the archive of a puff piece published on the Sequoia Capital website: they were talking up their book. They took it down when they wrote their investment in FTX down to $0 (from over $200mm). It was neither published recently nor by a MSM outlet.
As of 2008, options market makers are not allowed to naked short. [0] The only remaining exemptions to restrictions on naked short selling are for equity market makers. These market makers are still subject to delivery requirements (T+2). Plus, most/all aim to end each day flat
[0] section III of https://www.sec.gov/investor/pubs/regsho.htm
I don't think that's true. Neither C nor C++ would allow you to invoke a function with an incomplete type, regardless of whether it is a `struct` or an `enum`, so there's no ABI issues with forward declaring them, but you wouldn't be able to define or invoke a function that takes an incomplete type argument by value.
struct A;
enum B; // as you pointed out, not allowed by the C++ standard
// fine to declare, define, and invoke
void fooA(struct A*);
void fooB(enum B*);
// ok to forward declare, but you can't call them
void barA(struct A);
void barB(enum B);I think the only benefit of `_Pragma` is that it enables defining a macro that expands into a `#pragma` definition. I don't think there's any other use case beyond that.
I meant that they are processed before any syntactical analysis, so they're not particularly useful for this kind of thing. For example, these are all wrong usages of our hypothetical `#pragma unreachable`:
void foo();
#pragma unreachable
class bar
{
#pragma unreachable
};
namespace foobar {
#pragma unreachable
}
But pragmas can generally be used anywhere, barring tokenization issues. The end result is that `pragma unreachable` would likely end up turning into a magic function call inside the compiler, since it really only makes sense in a spot where you can invoke a function.Also, I think you are conflating pragmas with `__attribute__`, which is how you set per function optimization settings. If you do that with pragmas, then it isn't limited to a single function.
That was unclear on my part, but I meant a new compiler in terms of "new to the project", not "new to the C++ community". The linked SO answer only covers those three compilers, which illustrates the issue I was talking about (you need to add a new `#elif` branch)
1. It is a compiler defined function (`__builtin_unreachable()`), but the issue is that MSVC doesn't have it, so you need a different implementation per compiler [0]. Plus, if a new compiler shows up (besides MSVC/GCC/LLVM), you'd need to investigate what the correct way to express `__builtin_unreachable` is.
From a compiler perspective, using a function makes the most sense, since that fits into the existing control-flow analysis that the compiler will do. Pragmas are processed by the pre-processor, so they aren't appropriate for expressing control flow hints.
2. `std::to_underlying(t)` is a wrapper around `static_cast<std::underlying_type_t<std::remove_cv_t<std::remove_reference_t<decltype(t)>>>>(t)`. So a lot fewer characters. It's also useful since `std::underlying_type_t<T>` behaves weirdly if `T` is not an enum type.
I think you are maybe missing the context that C++ allows the representation of an enum to be defined, e.g. `enum class X : unsigned char {};` vs `enum class Y : unsigned long long {};`. So you can't always cast to `int`. Technically, this isn't the case in C either: the type defaults to `int`, but the compiler will pick a larger type if necessary, e.g. `enum Z { a = ((long long)INT_MAX) + 1 };`
3. `htonl` are not standardized, so they were not part of the C++ standard library. Also, on Windows, I believe you'd need to include `winsock.h` to get access to them, which has its own idiosyncratic issues. You are also missing the context of C++ defining operator overloading, so you can call `std::byteswap(0ull)` and get an `unsigned long long` and you can call `std::byteswap(std::uint16_t{0})` and get a 16 bit unsigned integer.
[0] https://stackoverflow.com/questions/60802864/emulating-gccs-...
Some scripts are better to either have explicit error handling code, or simply never fail.
Silently ignoring sub-commands that exit with a non-zero code is not the same thing as "never failing". Your script might return 0, but that doesn't mean it did what you expect it to.
Also, don't use set -o nounset when set -u will do.
`set -o nounset` is a lot easier to understand for the next person to read the script. Yes, you can always open the manpage if you don't remember, but that is certainly less convenient than having the option explained for you.
What shell are you using that doesn't support `set -o nounset`? Even my router (using OpenWRT+ash) understands the long-form version.
Only use that for bashisms where there's no POSIX alternative
I totally disagree. You expect people to know the difference between `[[ ... ]]` and `[ ... ]` well enough to know what the bash version is required? You expect the next person to edit the script will know that if they change the condition, then they might need to switch from `[` to `[[`?
How do you even expect people to test which of the two that they need? On most systems, `/bin/sh` is a link to `/bin/bash`, and the sh-compatibility mode of bash is hardly perfect. It's not necessarily going to catch a test that will fail in `ash` or `dash`.
I think the "YAGNI" applies to trying to support some hypothetical non-bash shell that more than 99% of scripts will never be run with. Just set your shebang to `#!/bin/bash` and be done with it.
I totally agree about `pipefail`, though. I got burned by this with condition like below: ``` if (foo | grep -Eq '...'); then ```
Since `-q` causes grep to exit after the first match, the first command exited with an error code since the `stdout` pipe was broken.
The risk profile is different. Yes, both have a payout that depends on your own mortality, but there are other risk factors to consider.
An annuity is also a credit risk: if the counter-party goes under, then your payments will stop. Since most of the time the counter-party is a well-capitalized insurance company (potentially with an implicit government backstop), this risk is pretty small.
On the other hand, a tontine has a risk profile that depends on the mortality of the other nominees who participate: your payout in a given year depends on the number of nominees still alive. Also, depending on how it's structured, there might be some market risk as well.
From another perspective, for there to be an arbitrage opportunity, you'd need a way to create a synthetic annuity using a tontine (or vice-versa). But the risk profile of the tontine, which depends on the mortality of the other nominees, is hard to come by unless you are an insurance company. You can view a participant in a tontine as owning a certain life annuity as well as having sold the other participants a smaller life annuity. So each time one of them dies, you no longer have to pay that life annuity and can keep more of the income from the annuity you own.
My understanding of the article was that the perpetrator was hit with a genuine DMCA notice that he was upset about. It seemed his plan was to generate these fake notices with the hope that they'd be noticed and rolled back, and in the confusion, he could get his notice rescinded as well.
It's entirely possible that /usr might be a separate partition from /, so hardlinks wouldn't work.
Most political consulting firms do the majority of their work for a single party, so they can reasonably be identified as either "Republican" or "Democratic". Some non-nefarious reasons why this clustering tends to occur:
* The firms are the next career stepping stone for campaign workers. If you have worked on half a dozen Democratic campaigns, you presumably believe in the cause and are unlikely to want to start working on Republican campaigns where you disagree with the candidate. (Maybe you won't be as good at working on GOP campaigns either). * If you are a politician, you are unlikely to be too excited to hire the firm that in the last election cycle wrote an ad trashing some of the positions you old. You are also more likely to get referred to a firm by a politician from the same party as you.
You might have firms that work with both parties, but they are likely to be working with centrist candidates from those parties.
So if this is a strategy firm that has mostly done political work for Republican candidates and causes, it seems perfectly reasonable to call it a "Republican strategy firm"
There is a lot to disagree with here. First, the article itself provides an example of an army with a superior fighting force that had far fewer casualties than the other side, yet still lost the war. That was due to the civilians back at home lacking the stomach for a long, protracted war abroad. So even if one side has superior strength, and even if the side with the superior strength wins every battle, they might still lose the war.
Another issue is your implicit assumption that the side with the superior fighting force will always win the war, but I don't think you can make that assumption. Just like the better football team can lose to the underdog, there is a stochastic element to warfare. A sudden bit of bad weather can turn the tide of a battle. There are countless other elements that are unobservable and unpredictable that can decide which side wins.
There are also asymmetric payoffs to going to war. A nation might have a slim chance of victory, but the cost of defeat or surrender might be genocide or subjection. How do you assign a payoff to the choice "surrender" when the outcome is the destruction of your nation as it once existed?
[0] https://en.wikipedia.org/wiki/Strategy_(game_theory)#Pure_an...
The breeder's equation described the expected change in a _population_ from one generation to the next due to selection pressures (natural or artificial).
For example, say a cattle rancher with a large herd may want to increase the average weight. So if he only breeds those animals in the top half of weight, what is the expected change in weight from one generation to the next?
For another example, say a particular species of lizard is hunted by a species of bird. The faster lizards are more likely to escape under a rock than the slower lizards. What is the expected change in average speed from one generation to the next?
Both of these examples have a well-defined _overall_ population and _reproducing_ population. The value of S can be calculated. In the first example, it is the difference between the mean weight of the top half of cattle and the mean weight of the entire herd. In the second example, it is difference in the mean speed of the lizards that are able to reproduce before being eaten and the entire population.
What are the analogous groups in the author's example? He doesn't define what distinguishes the population of 120 IQ parents from the population as a whole. In one reasonable reading, you could even think he means just two people when he says "a set of parents". That is what I mean about being fast and loose with terms: how are we defining the entire population and how are we defining the reproductive population?
Further, he says that 120 IQ parents having children with mean IQ of 110 is an example of regression to the mean. I would say the exact opposite: the 110 IQ children _define the mean_ of the next generation (in the correct usage of the equation). The expectation is that if there continues to be positive pressure on IQ, then future generations will continue to have increasing IQs.
With regards to "ideological warfare", the author himself explicitly introduced eugenics into the conversation with his analogy about the desert island populated by National Merit finalists (he literally described it as eugenics). His Wikipedia page [0] describes him as an anthropologist "who argues that cultural innovation resulted in new and constantly shifting selection pressures for genetic change, thereby accelerating human evolution and divergence between human races". I don't think it's unfair to say there are some unpleasant undertones to his work.
The author is playing fast and loose with definitions here. Other sources[0][1] (that I would consider more reputable) define the breeder's equation in terms of populations, but this author focuses on arbitrary and ill-defined subsets of populations.
Crucially, the author defines R as "the response to selection", but he omits the second part: "from one generation to the next". Source [0] defines it even more clearly: "the change in the mean [of the population] over one complete generation".
Similarly, S is the difference in the measured trait among the entire population and the population that reproduces. So when the author considers "a set of parents with IQs of 120", it only fits the correct usage of the equation if we take that to mean that mean IQ of all parents in this generation is 120. If that's his argument, how is he defining the population of parents?
In my opinion, this is a wishy-washy argument that seems like a subtle way of advancing eugenics (or something similarly distasteful).
[0] https://www.nature.com/scitable/knowledge/library/the-breede... [1]: https://public.wsu.edu/~gomulki/biol519/presentations/Sjober...