Your implication that google services are free is untrue.
You are paying with your privacy and data. And the price is such that, if I ever made a better mail service than gmail that openly asked to sell and privately use all your data, nobody would subscribe.
You are paying by seeing ads.
You are paying by being coerced into a certain ecosystem.
You are paying by having one company chose what standards are the de facto web standards of tomorrow. And their main business is selling your data.
You are paying by losing access to your data if a company feels like it.
etc.
I'm no mathematician, but I think that if you know something about the probability distribution before searching, then you can be more efficient than blindly using binary search. And if you assume Ballmer is out to get you (i.e. the distribution is not random) then you can use that information to improve the search speed.
If a second party can submit adversarial values into a system, potentially causing a denial of service in a binary search (where comparisons are computationally expensive and data is unevenly distributed), there is a much simpler solution: avoid using sorted collections and binary search. Instead, use hashmaps. To address similar HashDoS attacks, many implementations (in Python, Rust, Java, etc.) use a randomized hash function, which vaguely resembles the idea of randomizing starting value for binary search.
The point is that Ballmer is an adversary, and may choose the worst cases for binary search. As I understood, the algorithm in TFA holds against any choice.
As others said, if you don't expect adversary behavior in your data, it should be good enough.
Just mount the Graphics card vertically using a raiser cable. It more of a PC case problem that a motherboard problem. Also, it allows for better form factors, with spread out components and bigger fans.
This article is so infuriating I had to log in. All this article is underlined by the fact that Alice and Bob should try to get the most out of the negotiation regardless of needs. This is a rightist way of seeing the world, and in my mind childlike. With any level of maturity people should realize pizzas should be divided according to who needs it, whatever the definition of need is.
How about this way of dividing the pie: Alice and Bob describe theirs needs to a third party, and the third party gives each one what is needed. Or if no third party: just describe and justify your needs in an envelope, open both simultaneously, and share the pie.
The logic that "of course, everyone should take as much as they can" is an impasse. It doesnt make anyone truly happy, makes the person with the worse fallback an inferior to the other party during the negotiations, doesnt guarantee fairness, etc. And worst of all: it doesnt allow for human values such as empathy.
This article is an algorithm between programs, not any reasonable way to treat a person, valuing their feeelings and needs.
I grew up in a small village. I always like to think how my village would look when theories like these would be applied.
Would my village be a happier, better place if the one or two families who already own most land used it as an leaverage to extort as much resources as they could from the others? Quite definitly not.
The idea here is that the individual cannot trust the group to consider their needs. This is not a theory it is a collective lifestyle choice. There are countries and regions where the opposite (people looking out for each other depending on their needs) works out just fine.
In German we speak of something called the Gesellschaftsvertrag — the implicit contract each individual has with society. It can be extremely enlighting think about whether someone subscribes to this contract and if not, why. E.g. someone who has been convicted for years of prison for a minor drug charge while bankers who steal billions go free, might just stop to believe it pays off to honor the rules of the contract. Someone who thinks everybody else is just a fool to extract money from probably even thinks of society as something with implicit rules.
However every human society, even societies with slavery, genocide, etc had these implicit rules of what a wealthy person was expected to provide, what a poor person was expected to endure. Break the contract on a large enough scale and you get a violent change of power or a revolution.
I find it very bloated. I spend so much time waiting on the compiler and writing boilerplate code (as opposed to actual features), that I try to avoid it when I can.
I really prefer Vue, because it gets out of my way when declaring services or making modules etc.
The guy's ranting about Typescript with no strong arguments to back up his diatribe.
He also described the experience of writing simple apps that resulted in very poor performance. From my experience, you'd have to really hard to re-create non performance scenarios. Especially if he is only creating simple use cases
In summary he is ranting about fairly superficial points that does not cancel out the benefits angular framework provides for certain types of organizations, when compared to vue or react..
Does anyone know how to solve the tennis-ball formula?
All I can muster is that the distance on the beach (b) divided by the speed on the beach (Vb) + the distance on water (w) divided by the speed on water (Vw) should be minimized. So I should find the minimum of b/Vb + w/Vw , but I have no clue as how.
You got the first equation right, in expressing time-taken in terms of b and w.
Now you need the second equation, which expresses b in terms of w (or vice-versa). Hard to describe it here over text, but I believe using the following set of equations, it should be possible to express b in terms of w.
------------------
Yb = vertical-distance from start-point to water (constant)
Yw = vertical-distance from water to end-point (constant)
Xb = horizontal-distance between start and point-of-contact with water
Xw = horizontal-distance between end and point-of-contact with water
X = horizontal-distance between start/end points (constant)
Ob = angle taken when running towards the water
Ow = angle taken when swimming towards the end point
You need to draw some triangles and relate b to w. Assuming a still, straight shore, the answer will depend on your distance to the waterline, the ball's distance to the waterline, and the distance parallel to the shore separating your starting spot and the ball's spot.
On a graph, plot b/Vb, with b on the horizontal axis and b/Vb on the vertical axis. This plot shows the time you spend on the beach if you run to b on the beach.
Add to this graph a plot of w/Vw. You'll have to express w as a function of b to do this. This plot shows the time you spend in the water if you run to b on the beach and then swim to the ball.
You are trying to minimize the sum of these two plots.
You can see from the plots that as b increases, beach time goes up, and water time goes down. As b decreases, beach time goes down and water time goes up.
If b is less than the minimizing point, water time changes more than beach time as b changes, so you can lower the total by moving b in the direction that makes water time go down. That will make beach time go up, but since water time changes more than beach time, it's a net win.
When b is more than the minimizing point, beach time changes more than water time as b changes, so you can lower the total time by moving b in the direction that makes beach time go down. The will make water time go up, but since beach time changes more than water time, it's a net win.
The minimizing point is the point where the rate beach time is changing and the rate water time is changing match, so that you cannot lower the time by nudging b in either direction.
What you could then do is think about how to calculate the rate of change of a function. Say you have a function, f(x), and you want to know how fast it changes as x changes. To help with intuition, let's say f(x) is the position of a car at time x. The rate of change of position is velocity, so we are asking how you find the velocity at a given point x if you know position as a function of x. If the car was moving at a constant velocity, this would be easy. Just note the position at x, f(x), and then note the position a little bit later, say at x+t, f(x+t). Then the distance traveled is f(x+t)-f(x), in time t, so the velocity is (f(x+t)-f(x))/t.
If the car is not moving at constant velocity that just gives you the average velocity during the time t. If the car isn't accelerating too much, the smaller t the closer the average velocity over an interval t should be to the instantaneous velocity at t.
For example, suppose f(x) = x^2. Then f(x+t) = x^2 + 2xt + t^2. The average velocity is 2x + t. It's pretty obvious that as we make t smaller and smaller, this gets closer and closer to 2x, and so we can reasonably conclude that the instantaneous velocity of something whose position at time x is f(x) is 2x.
Applying those same ideas to the functions involved in the ball problem, you could figure out the rates of change, and find the b that makes the beach time and the water time rates of change match. Unlike the nice x^2 car, though, the algebra would be messy and error prone.
After you have done that, you might realize that this operation of take an average over smaller and smaller intervals and seeing if that converges to some fixed value as the interval goes to zero is quite useful, and start studying it. You'd then discover that while computing it directly can be a royal pain in the ass, it turns out that if your function is built up of other functions by adding, subtracting, multiplying, dividing, or applying functions to other functions, and you know how to do this operation on the component functions, then there are simple rules that you can follow mechanically do figure it out on the combined function.
At that point, you've pretty much invented half of calculus as it was understood back in the days of Newton and Leibniz, and are ready to tackle all kinds of minimization and maximization problems in physics, engineering, finance, and elsewhere, plus all kinds of problems involve rates of change, such as bacteria growth, velocity of water coming from a hole in the bottom of a leaky bucket, and rocket motion.