• map (unregistered)

    There wasn't any use for this frist at all.

  • Andrew (unregistered)

    If comment words <= 10 Reject frist else words/2 <= 20 Insert "If there's no use let someone else be frist then! " else frist!

  • Dav Brown (unregistered)

    Thanks for share Good post. There was not any use for this.

    Exam Cetify

  • map (unregistered)

    Even the spambot agrees!

  • davesol (unregistered)

    At least the code had comments

  • cheong (nodebb)

    Maybe he want something like this but used wrong formula?

    return (pow(pow(location.horizontalAccuracy, 2) + pow(location.verticalAccuracy, 2), 0.5) <= 10);

  • M (unregistered)

    If you've got multiple sources of position-related information, you shouldn't throw away a source of data just because the error bars are large. You should use a Kalman filter or something similar, appropriately tweaked to properly handle a data source vanishing entirely (e.g., GPS in a building with thick walls.)

  • Pierre Lebeaupin (unregistered)

    Goddammit let me grab a machine gun. At least apps like, say, Pokemon Go have a good reason to drain our battery so much, but here… you'd think QA would notice something. Rhaaaaa!

  • Dan (unregistered) in reply to cheong

    I can never fathom why people would use exponential functions when they don't have to. cheong / nodebb: Why not return location.horizontalAccuracylocation.horizontalAccuracy + location.verticalAccuracylocation.verticalAccuracy <= 100;

    Maybe I'm crazy for coming from a high-performance background where we didn't make unnecessary exponent calls for no reason, but I can never understand people who would continuously calculate linear distance with 3 exponential function calls.

  • Helix (nodebb)

    "Hikari was working on an augmented reality game for a very specific problem domain. In this use case, GPS was going to be unreliable."

    So a specialist dating app?

  • Cardboard (unregistered)

    This was pokemon go wasn't it.

  • cheong (nodebb) in reply to Dan

    Just to show the formula he ought to be trying to use. Taking the pow(,0.5) away will make it look less obvious.

    Never thought I would need to do optimization on here. :shrug:

  • jerzyszczur (unregistered) in reply to cheong

    If you're aiming for readability, write a separate function for that:

    inline bool isWithinRadius(int x, int y, int radius) { return xx + yy <= radius*radius; }

    And then:

    […] return isWithinRadius(location.horizontalAccuracy, location.verticalAccuracy, 10); […]

  • John (unregistered)

    I would make a metric that returns 1 at best accuracy and >1 otherwise. Then make it clear when this metric

    var accuracy = min(vert/3, horiz/5);
    if( accuracy > 2.0) // Check against a safety factor of 2.0
  • Ex-lurker (unregistered) in reply to Dan

    You're failing at math. You're right about doing away with the outermost pow() while swapping 100 in the comparison but by taking the other two pow() away you messed up the calculation.

  • Tim! (unregistered) in reply to Ex-lurker

    Nah, the comment system just ate the multiplication operator.

  • Ron Fox (google)

    It's only a game.

  • dkf (nodebb)

    TRWTF is Objective-C, amirite?

  • thosrtanner (unregistered)

    Staring hard at the first comment and I can only see one typo in that.

  • Daniel (unregistered) in reply to M

    Wow, I actually learnt something from the Comment section!

  • Scarlet_Manuka (nodebb)

    The article seems to be making a great deal of fuss about trying to understand what is actually a pretty simple and clear line of code.

    Yes, it's taking an average; adding two things together and then dividing by two is how you do that when you have two things. Lower is better, so it's quite reasonable to set a threshold value for what you consider to be good enough. There's not much wrong with this in itself; as others have said, the sum of squares would be a better measure, but if all you want is a rough idea of "signal or no signal", then this is probably adequate.

    It's even reasonable that they kept the GPS polling code around since they were contemplating using it for minor fixups. The only WTFs are that they polled the GPS so frequently, and that they didn't disable the GPS polling until they had code that made use of it. Oh, and the mismatch between "10" in the comment and "20" in the code, but that's trivial.

  • masonwheeler (github)
    • (BOOL)_locationIsAccurate:(CLLocation *)location

    What language is this?!?

  • Omego2K (unregistered) in reply to masonwheeler

    Objective C

  • Thou (unregistered)

    Well at least the comments "helped" Steve figure out the problem. Imagine there were no comments, he would be left wondering what is going on.

  • Anonymouse (unregistered)

    TRWTF is that horizontalAccuracy and verticalAccuracy are high when location is highly inaccurate.

  • Nigger (unregistered)


  • Scott (unregistered)

    I think my browser is old or not supported for the post, i cant seen any portfolio or image, but i can read the text and i enjoyed the post you shared... Custom Made Suits Hong Kong Casio G Shock Watches UK

  • animal jam (unregistered)

    The blog or and best that is extremely useful to keep I can share the ideas of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much. animal jam | five nights at freddy's | hotmail login

  • hill climb racing 2 (unregistered)

    There is definately a lot to know about this subject. I like all of the points you've made. hill climb racing 2

  • a10 (unregistered)

    You’ve written nice post, I am gonna bookmark this page, thanks for info. I actually appreciate your own position and I will be sure to come back here. animal jam, a10, color switch

  • Ethenrosethomaz (unregistered)

    one of the best download bigo live online chatting application

  • Ethenrosethomaz (unregistered)

    one of the best download bigo live online chatting application

  • Seo experts (unregistered)

    I am glad to have visited this site. It is a well-designed site and also contains useful information for the visitors. you can learn Course Training of Digital Marketing Training at Digital Marketing Course Training institute and we also provide training for web designing at Web Designing Course Training Institute by our Google Adwords PPC management Company and you can also avail Google Adwords PPC Service from us or call at Kobo Customer Service Support Phone Number and if you face any printer issue, you can call at Brother Printer Support Number and if you have Quickbooks issue then call at Quickbooks Support Number and you get solution for your Quickbooks problem and call at PPC Technical support

Leave a comment on “O User, Where Art Thou?”

Log In or post as a guest

Replying to comment #:

« Return to Article