(no title)
Throwadev | 12 years ago
Yes, radius varies, but the OP's solution addresses that, so what's your point?
10/10 would be drenched in smugness again.
Throwadev | 12 years ago
Yes, radius varies, but the OP's solution addresses that, so what's your point?
10/10 would be drenched in smugness again.
tantalor|12 years ago
Michael complained that the query repeated the same computation each time, which is an odd thing to say, because that is its purpose. He expected memoization, which the library function did not offer, so he added that. But there's no reason to be dissatisfied with the code for not doing something its not supposed to do, or its developers for not adding an unnecessary feature.
His memoization does support varying radius, but only in a narrow subset of {5, 10, 20, 30, 40, 50}. Of course this is a huge performance optimization for the app, but in general it is impractical for provide memoization like this for an arbitrary radius.
jesusmichael|12 years ago
Memorization=tabling which is exactly what I'm doing, but in a static sense.
Yes, its narrow, but the owners of the app don't want more than the 6 options given.
My point is that doing calculating the area of a circle around a give point on earth more than once is redundant. points on the earth don't move so if two points are within 1 mile of each other. They will always be so..