Android looks to the future



  • We all know that it's best practice to provide symbolic names for commonly used numerical constants, to avoid mysterious magic numbers appearing in your code.

    It's also wise to plan ahead and think about possible ways that your code might be used in the future.

    With that in mind, it's immediately clear why Android chooses to include the following constants in its public API (android.hardware.SensorManager):

        /** Standard gravity (g) on Earth. This value is equivalent to 1G */
        public static final float STANDARD_GRAVITY = 9.80665f;
    
    /** Sun's gravity in SI units (m/s^2) */
    public static final float GRAVITY_SUN             = 275.0f;
    /** Mercury's gravity in SI units (m/s^2) */
    public static final float GRAVITY_MERCURY         = 3.70f;
    /** Venus' gravity in SI units (m/s^2) */
    public static final float GRAVITY_VENUS           = 8.87f;
    /** Earth's gravity in SI units (m/s^2) */
    public static final float GRAVITY_EARTH           = 9.80665f;
    /** The Moon's gravity in SI units (m/s^2) */
    public static final float GRAVITY_MOON            = 1.6f;
    /** Mars' gravity in SI units (m/s^2) */
    public static final float GRAVITY_MARS            = 3.71f;
    /** Jupiter's gravity in SI units (m/s^2) */
    public static final float GRAVITY_JUPITER         = 23.12f;
    /** Saturn's gravity in SI units (m/s^2) */
    public static final float GRAVITY_SATURN          = 8.96f;
    /** Uranus' gravity in SI units (m/s^2) */
    public static final float GRAVITY_URANUS          = 8.69f;
    /** Neptune's gravity in SI units (m/s^2) */
    public static final float GRAVITY_NEPTUNE         = 11.0f;
    /** Pluto's gravity in SI units (m/s^2) */
    public static final float GRAVITY_PLUTO           = 0.6f;
    /** Gravity (estimate) on the first Death Star in Empire units (m/s^2) */
    public static final float GRAVITY_DEATH_STAR_I    = 0.000000353036145f;
    /** Gravity on the island */
    public static final float GRAVITY_THE_ISLAND      = 4.815162342f;
    

     Of course, TRWTF here is that they haven't made it clear which specific island the last one refers to!

     



  • 'The Island'. I.e. the one from Lost.



  • The gravity on the first Death Star is not that useful since it has been destroyed by those rebel scum.



  • I generally don't care for Google, but I have to admit they have a good sense of humor.



  •  Then someone develops a "Calculate your Golf Driving Distance on Other Planets" app, which sells wildly making him rich, while the rest of us wonder how in the name of f*ck there so many people around that are willing to pay for that. @TheMugs said:

    The gravity on the first Death Star is not that useful since it has been destroyed by those rebel scum.
    True, but if you're willing to concede to the existence of the Death Star, it's not inconceivable that a time machine exists as well.

    Edge cases. You have to think edge cases here.



  • @Flatline said:

    'The Island'. I.e. the one from Lost.
     

    Are you sure it's not the one you get to visit when you win the lottery?

    (I can (proudly?) say that I've never seen a single episode of Lost.)



  • Whoever wrote that is a noob. They should have defined the gravities of everything relative to STANDARD_GRAVITY, not use hardcoded constants for each of them. At the very least they should've set GRAVITY_EARTH = STANDARD_GRAVITY instead of using the same constant twice.

    Also, Pluto isn't a planet.

    Also, GRAVITY_URANUS. Heh.

    @Flatline said:

    'The Island'. I.e. the one from Lost.

    So it doesn't exist on Earth?



  • @TheMugs said:

    The gravity on the first Death Star is not that useful since it has been destroyed by those rebel scum.

    Plus, is it Death Star I or Death Star II? They were different sizes, II was much bigger. Edit: I NO CAN READ!!!!! Ignore that.

    And yeah, it's a Lost joke. "The Island" has funky gravity and magnetism stuffs. Read the numbers: 4, 8, 15, 16, 23, 42. And it travels through time, and psychic smoke monsters and 4-toed statues who kidnap kids and dogs and I never watched the last two seasons.



  • Let me say first that I don't watch Lost, saw the couple first episodes and decided that a tv series that could be compressed into *tree branch moving, *strange noise, *flashbacks, *some sort of survivors show was not for me.

    The gravity is not uniformed on the earth, there are fluctuation albeit small ones so it could make sense to store some locations gravity measures as well

    Other than that I don't see the joke, the Death Star is pivotal to Google world domination plan.



  • @blakeyrat said:

    ... I never watched the last two seasons.

    I can smell your lie through the Internets.



  • @The_Assimilator said:

    @blakeyrat said:
    ... I never watched the last two seasons.

    I can smell your lie through the Internets.

    Ok I watched like half of one episode but they were like already escaped from the Island and it was in the future and half of the cast was dead and I went "WTF?" and turned it off. Then never came back. So if you count that, then yes.



  • @Wrongfellow said:

        /** Standard gravity (g) on Earth. This value is equivalent to 1G */
    public static final float STANDARD_GRAVITY = 9.80665f;
    Or, at least it is equivalent if you use the right made-up units.



  • @The_Assimilator said:

    Also, Pluto isn't a planet.

    Nor is the Moon or the Death Star. More seriously, it probably was when this file was first created.

    @The_Assimilator said:

    @Flatline said:
    'The Island'. I.e. the one from Lost.

    So it doesn't exist on Earth?

    Apparently not. I only watched the first two seasons before I realised that it wasn't just the viewers that had no idea what was going on.



  • True.

    But at the same what would I want to go on the Death Star ? I seems to be made of only hallway, prison, control room, generator and giant pitfall. There's no bathroom, no spa, no pool and no amusement park. For a thing of this size, I'm expecting more.



  • @TheMugs said:

    True. But at the same what would I want to go on the Death Star ? I seems to be made of only hallway, prison, control room, generator and giant pitfall. There's no bathroom, no spa, no pool and no amusement park. For a thing of this size, I'm expecting more.

    That is what they want you to believe, man, I been there man, is totally wicked man, on the level, like those corporate retreats, where do you think Vader worked his kinks out?

    The problems is that normal people can't go, only execs and VIPs



  • @serguey123 said:

    That is what they want you to believe, man, I been there man, is totally wicked man, on the level, like those corporate retreats, where do you think Vader worked his kinks out?

    The problems is that normal people can't go, only execs and VIPs

    I don't believe you, we all know Darth Vader destroy planet and choke people to death to work is kinks out.



  • @TheMugs said:

    I don't believe you, we all know Darth Vader destroy planet and choke people to death to work is kinks out.

    No man, that is his day job, he works for the empire, the emperor is the one that loves that stuff.

    Lord Vader does Ikebana, has a sauna (don't you remember that scene in the movie?) and enjoy writing philosophy and calligraphy.

    He gets all the perks as the Empire CEO.



  • @The_Assimilator said:

    @Flatline said:
    'The Island'. I.e. the one from Lost.

    So it doesn't exist on Earth?

    Those are the numbers, a recurring theme on Lost. 

    Unfortunately, I admit to watching every episode of that show.  I got sucked in early on, and was hoping they would wrap it up cleverly.  Instead, they just kept forking the plot until I couldn't even remember what had happened in previous episodes.  Oh well.



  • I wonder if gravity has an effect on the teleportation of goats.



  • @serguey123 said:

    @TheMugs said:

    I don't believe you, we all know Darth Vader destroy planet and choke people to death to work is kinks out.

    No man, that is his day job, he works for the empire, the emperor is the one that loves that stuff.

    Lord Vader does Ikebana, has a sauna (don't you remember that scene in the movie?)

    You mean this one?

     



  • @blakeyrat said:

    I never watched the last two seasons.
     

    I gave up on it after a couple of weeks of previews telling me that "all your questions will be answered on this week's Lost".  Not only were my questions left unanswered but they added in more weird stuff.

    If I want to be immersed in a world where nothing makes sense and I don't know what's happening I just go into work.



  • @serguey123 said:

    The gravity is not uniformed on the earth, there are fluctuation albeit small ones so it could make sense to store some locations gravity measures as well

    By spooky coincidence, today's XKCD (I know, sorry!).



  • @too_many_usernames said:

    Are you sure it's not the one you get to visit when you win the lottery?
     

    No, quite sure it isn't. The gravity on that island is either 9.8ms-2 or FILE_NOT_FOUND.

     



  • @SenTree said:

    By spooky coincidence, today's XKCD (I know, sorry!).

    I didn't think I'd ever say this but :D



  •  It's best not to comment on the gravity around uranus.



  • @DaveK said:

    @serguey123 said:

    @TheMugs said:

    I don't believe you, we all know Darth Vader destroy planet and choke people to death to work is kinks out.

    No man, that is his day job, he works for the empire, the emperor is the one that loves that stuff.

    Lord Vader does Ikebana, has a sauna (don't you remember that scene in the movie?)

    You mean this one?

    Whoa, the internet does have everything, yes I meant that scene.  Now if you could whip me a scene of Darth Vader new gig as a yoga instructor?



  • Not sure where you got the idea that Android was looking to the future, but the values of solar objects are currently valid and I believe the whole Death Star thing happened a long, long time ago.



  • @serguey123 said:

    ...

    The gravity is not uniformed on the earth, there are fluctuation albeit small ones so it could make sense to store some locations gravity measures as well

    ...

     

    and until tommorow: also http://xkcd.com/

    Edited out the hotlink of the comic because a) it wastes space.  I read it this morning like everyone else and b) Save Randall some bandwidth, okay? -btk



  • I think there was one missing comment in the OP's source:

    /** Standard gravity (g) on Earth. This value is equivalent to 1G */
    public static final float STANDARD_GRAVITY = 9.80665f;

    /** Sun's gravity in SI units (m/s^2) */
    public static final float GRAVITY_SUN = 275.0f;
    /** Mercury's gravity in SI units (m/s^2) */
    public static final float GRAVITY_MERCURY = 3.70f;
    /** Venus' gravity in SI units (m/s^2) */
    public static final float GRAVITY_VENUS = 8.87f;
    /** Earth's gravity in SI units (m/s^2) */
    public static final float GRAVITY_EARTH = 9.80665f;
    /** The Moon's gravity in SI units (m/s^2) */
    public static final float GRAVITY_MOON = 1.6f; //That's no moon....Obi.
    /** Gravity (estimate) on the first Death Star in Empire units (m/s^2) */
    public static final float GRAVITY_DEATH_STAR_I = 0.000000353036145f;



  • @esoterik said:

    xkcd full image insert
     

    SenTree kind of beat you to that chase.



  • @serguey123 said:

    @DaveK said:

    @serguey123 said:

    @TheMugs said:

    I don't believe you, we all know Darth Vader destroy planet and choke people to death to work is kinks out.

    No man, that is his day job, he works for the empire, the emperor is the one that loves that stuff.

    Lord Vader does Ikebana, has a sauna (don't you remember that scene in the movie?)

    You mean this one?

    Whoa, the internet does have everything, yes I meant that scene.  Now if you could whip me a scene of Darth Vader new gig as a yoga instructor?

    Well, sure, no problem, but you really could have googled it yourself you know...

     


  • 🚽 Regular

    @DaveK said:

    @serguey123 said:


    Whoa, the internet does have everything, yes I meant that scene.  Now if you could whip me a scene of Darth Vader new gig as a yoga instructor?

    Well, sure, no problem, but you really could have googled it yourself you know...

     

    This truly is one of the most epic forum conversations I've read in a while.



  • They really blew it on this one, when the constant of gravity changes they have to go back and change all those numbers.



  • @DaveK said:

    @serguey123 said:

    @DaveK said:

    @serguey123 said:

    @TheMugs said:

    I don't believe you, we all know Darth Vader destroy planet and choke people to death to work is kinks out.

    No man, that is his day job, he works for the empire, the emperor is the one that loves that stuff.

    Lord Vader does Ikebana, has a sauna (don't you remember that scene in the movie?)

    You mean this one?

    Whoa, the internet does have everything, yes I meant that scene.  Now if you could whip me a scene of Darth Vader new gig as a yoga instructor?

    Well, sure, no problem, but you really could have googled it yourself you know...

     

    I'm seriously considering the possibility of me having god-like powers or the fact that the internet is god.


Log in to reply