Because quicksort is like a worst case scenario for branch prediction.
Branch prediction works when the CPU can detect some kind of pattern in the program behavior, like if the branch usually goes one way and rarely goes the other way. If it predicts correctly, the CPU pipeline keeps going without stalling. If it predicts incorrectly, the CPU wastes time doing work that it has to throw away. Therefore, being able to predict correctly is essential.
In quicksort, you partition an array into two halves based on whether each element is smaller or larger than the pivot value. The key to good quicksort performance is to choose a good pivot which divides the values in half about equally. This means (assuming you're sorting randomly-ordered data) that the branching behavior will be totally unpredictable, like flipping a coin. So branch prediction will be basically useless.
Copying small chunks of data is OK if it all fits in cache, especially if it all fits in L1 cache. It's not ideal to copy data unnecessarily, but if it allows you to keep the CPU pipeline running at full speed with no stalls, it can be a good trade-off.
The symmetry is amusing. This is really fighting fire with fire.
Mosquitoes are a vector that spreads disease-causing germs to a population. The proposed solution is to use different mosquitoes as different vector that spreads a different disease-causing germ to a different population.
> raise sterile males and release them into wild insect populations. When a wild female mates with a sterile male, her eggs won’t hatch. The population gets smaller with each generation.
They won't harm then it sounds like, but they'll not fertilize the eggs.
OK, you bring up a very good point. If the eggs fail to hatch because they are never fertilized, then the mosquitoes are not acting as a vector because they do not transmit the disease. I didn't even consider that possibility.
That wikipedia article says that there are embryos, but the embryos die.
However, the real question to ask, I guess, is whether the embryo is infected. As I read that article, it sounds like it isn't. Instead, the male parent is infected and this creates sperm which can fertilize the egg but in a way that creates an embryo that can't survive. In other words, the male parent has an infectious disease which causes the embryo to have a fatal genetic disease.
So this also brings up another question: what exactly is a vector? In this scenario, the embryo has a disease it would not otherwise have gotten, if it weren't for this germ. However, the embryo doesn't have the germ itself. Is being a vector defined by whether some disease is caused, or is it defined by whether the germ is spread? I don't know.
Also, cleaning kitchens is a huge part of the job. Hotel rooms either have no kitchen or a very minimal one. You're not going to learn how to clean an oven or load a dishwasher in a hotel room. (And loading a dishwasher requires categorizing thousands of things as dishwasher safe or not! Stainless steel skillet, yes; cast iron skillet, no; etc.)
Maybe I'm weird, but I believe in the theory that (all else equal) it's good for business to minimize how much your users hate your product/service.
In other words, users dislike the feeling of not knowing whether things are ads. I can't see any real downside to labeling them, so you're better off doing it so you don't drive users away.
Have a rod that pivots in its center and has objects of equal mass at each end, like a balanced seesaw. But make one of the objects very low density (less than water) and other high density.
Since the densities differ, water will cause the rod to rotate. But since the masses are the same, bumps will create no net torque around the pivot point and thus no rotation.
ASCII art diagram:
F------(x)------C
(x): pivot point
F: float
C: counterbalance
Also include a small spring to keep the float in the down position.
I'm sure there are other ways like sensing the electrical resistance of the water.
Or just let the float sensor bounce. It's underwater when it stops bouncing and is continuously in the up position.
I surrender my speedometer ceremony for the wade sensor. Instead of a motor sweeping the speedometer from 0 to 200 on startup, put the motor to sweep the wade sensor.
Waymos are fleet vehicles. Recalls go to the owners, just like with other fleet vehicles such as rental cars, taxis, limos, delivery services, utilities, and city/state/federal government. It doesn't really matter who is whose customer.
The article mentions this: "A few years back, Linux added a way for software to wait on several events at once, which is something Windows had built in for decades, but Linux didn't."
Here's a better comparison to pro athletes. Their work output is winning games. How do they get good at (and stay good at) that? Is it by playing real games for points?
That's a part of it, but only a small part. They don't get good at the thing mainly by doing the thing. They get good at it by training to do the thing.
An NFL football player does a ton of things other than playing in games. They have practice scrimmages. They do drills like throwing, catching, running patterns, tackling, reading quarterbacks, stripping balls, picking up fumbles, etc. They work with coaches on their technique. They watch film. They spend many hours in the gym and on the track building their strength, speed, cardio, and stamina.
Yes, it's true that your software skills will atrophy if you don't use them. But that doesn't mean your skills have to get worse and worse causing you to eventually quit the job. It means you need to set aside time to maintain your skills. It may no longer happen automatically as a side effect of your work, but it can happen intentionally instead.
Branch prediction works when the CPU can detect some kind of pattern in the program behavior, like if the branch usually goes one way and rarely goes the other way. If it predicts correctly, the CPU pipeline keeps going without stalling. If it predicts incorrectly, the CPU wastes time doing work that it has to throw away. Therefore, being able to predict correctly is essential.
In quicksort, you partition an array into two halves based on whether each element is smaller or larger than the pivot value. The key to good quicksort performance is to choose a good pivot which divides the values in half about equally. This means (assuming you're sorting randomly-ordered data) that the branching behavior will be totally unpredictable, like flipping a coin. So branch prediction will be basically useless.
Copying small chunks of data is OK if it all fits in cache, especially if it all fits in L1 cache. It's not ideal to copy data unnecessarily, but if it allows you to keep the CPU pipeline running at full speed with no stalls, it can be a good trade-off.
reply