News for hackers. Stuff that matters.
Re:Show HN: I taught my little brother JS, and he made this ... by juretriglav on Wednesday January 09, 2019 @01:48PM (#18867481)
Hasn’t been mentioned before: try this on a phone. It uses the gyroscope for control and it quickly becomes second nature to balance/guide the square around the screen. Also a very nice and rewarding discovery process, as it starts out with squares speeding by, until you realize it’s the tilt of your phone that is causing it. Congrats, super fun!
Re:Show HN: I taught my little brother JS, and he made this ... by crystalmace on Wednesday January 09, 2019 @04:06PM (#18868883)
Or your Macbook Pro if it originally came with an HDD. Apparently the device orientation API can utilize the triaxial accelerometer that Apple used for drop detection. Really neat experience tilting my laptop around like a mad man.
Re:Show HN: I taught my little brother JS, and he made this ... by saagarjha on Wednesday January 09, 2019 @04:14PM (#18868959)
That's…quite surprising. It's a cool feature, but I'm afraid that it's just another surface that can will be used for browser fingerprinting.
Re:Show HN: I taught my little brother JS, and he made this ... by dddddaviddddd on Wednesday January 09, 2019 @04:24PM (#18869053)
Surely it asks explicitly for permission to use the sensor?
Re:Show HN: I taught my little brother JS, and he made this ... by pedrocx486 on Wednesday January 09, 2019 @05:00PM (#18869393)
Chrome does not, no.
Re:Show HN: I taught my little brother JS, and he made this ... by crsv on Wednesday January 09, 2019 @10:30PM (#18871281)
Mobile safari on an iPhone XR just worked.
Re:Show HN: I taught my little brother JS, and he made this ... by chupasaurus on Thursday January 10, 2019 @09:06AM (#18873861)
Can confirm that HP Probooks had the same accelerometer in 2011-2014. Win8 used it for screen orientation OOTB.
Re:Show HN: I taught my little brother JS, and he made this ... by firmgently on Thursday January 10, 2019 @11:53AM (#18875384)
pioneered I believe by ThinkPads in 2003 http://www.thinkwiki.org/wiki/Active_Protection_System
Re:Show HN: I taught my little brother JS, and he made this ... by JCharante on Wednesday January 09, 2019 @04:52PM (#18869326)
Do MacBooks that shipped with an SSD not have the accelerometer?
Re:Show HN: I taught my little brother JS, and he made this ... by stinkytaco on Wednesday January 09, 2019 @07:50PM (#18870570)
My understanding was that the accelerometer was there to stop the drive in case of a fall. You wouldn't need that with an SSD, though perhaps if it still had an optical drive?

EDIT: I should add that both the HDD Macs I owned (a 2009 Macbook Pro and a 2004 or 03 Macbook) had accelerometers and I found a cool app for oldest that made a lightsaber noise. This was pre smartphones, so it was novel. My Late 2013 Macbook Pro does not seem to have one.

Re:Show HN: I taught my little brother JS, and he made this ... by Wowfunhappy on Wednesday January 09, 2019 @05:08PM (#18869472)
My 2012 Macbook Air had an accelerometer and of course shipped with an SSD. No idea if it's in the newer Airs, or why it's there.
Re:Show HN: I taught my little brother JS, and he made this ... by geofft on Wednesday January 09, 2019 @07:34PM (#18870499)
My MacBook with an SSD (12", 2017) does not have an accelerometer as far as either my web browser or `pmset -g` can tell.
Re:Show HN: I taught my little brother JS, and he made this ... by colordrops on Wednesday January 09, 2019 @03:54PM (#18868781)
Kind of disturbing that Chrome just provides gyroscope data without any notification to the user.
Re:Show HN: I taught my little brother JS, and he made this ... by manfredo on Wednesday January 09, 2019 @03:59PM (#18868835)
What would one feasibly do with this data? I guess an app could tell if someone is holding their phone in their had, and maybe put together a pedometer bases on gyroscope input. Maybe a concern if a app has access to gyro input over a period of days.

But as long as it's only for actively open apps and web pages I don't really see much harm.

Re:Show HN: I taught my little brother JS, and he made this ... by JeremyBanks on Wednesday January 09, 2019 @04:29PM (#18869108)
With sufficiently high-frequency gyroscope data, it is possible to infer what a user types in with moderate precision. In some cases, it has even been shown to be possible to recover coarse audio data from the surrounding environment.

https://bugs.chromium.org/p/chromium/issues/detail?id=421691

Browsers have added rate limiting to mitigate this threat. (Prior to that, my former team in Google Ads added our own rate limiting to the gyroscope API we provided for ads.) The risk now seems pretty minor, but I wouldn't be shocked if someone clever still managed to find some way to abuse it.

Re:Show HN: I taught my little brother JS, and he made this ... by gowld on Wednesday January 09, 2019 @05:34PM (#18869701)
> gyroscope API we provided for ads

Whaaaa?

Re:Show HN: I taught my little brother JS, and he made this ... by JeremyBanks on Wednesday January 09, 2019 @05:53PM (#18869853)
Yeaaaaah. Our clients thought it was super-cool to add distracting battery-destroying parallax effects to their mobile ads. :|
Re:Show HN: I taught my little brother JS, and he made this ... by tomaskafka on Thursday January 10, 2019 @01:28PM (#18876477)
What business model do you think Google has?
Re:Show HN: I taught my little brother JS, and he made this ... by aw3c2 on Wednesday January 09, 2019 @04:30PM (#18869111)
Re:Show HN: I taught my little brother JS, and he made this ... by colordrops on Wednesday January 09, 2019 @05:35PM (#18869707)
Facebook has a patent for using gyroscope data in conjunction with location to know who you are facing with other people around to enhance friend suggestions.

You can also determine things like health and other physical characteristics, similar to gait detection.

Re:Show HN: I taught my little brother JS, and he made this ... by tsukikage on Wednesday January 09, 2019 @06:18PM (#18870024)
...wait, how do you get orientation relative to things around you (rather than just your own previous orientation and gravity) from just gyro/accelerometer data + location?

If you do have some source of absolute orientation, like a compass, surely you just use that and don't need the gyro.

Re:Show HN: I taught my little brother JS, and he made this ... by gugagore on Wednesday January 09, 2019 @10:31PM (#18871284)
That's a good question. I suppose it may be possible to use GPS data to estimate the phone's absolute heading.

I just took a quick look at https://developer.mozilla.org/en-US/docs/Web/API/Detecting_d..., and it seems to provide orientation, and not angular velocities. So it could also be that browser implementations fuse magnetometer and inertial sensors to produce the orientation estimate. Is there another gyro API?

Re:Show HN: I taught my little brother JS, and he made this ... by jefftk on Wednesday January 09, 2019 @10:42PM (#18871328)
Maybe the compass gives you noisy absolute information which is ok, but combined with accurate relative information from the gyroscope and accelerometer is better?
Re:Show HN: I taught my little brother JS, and he made this ... by saagarjha on Wednesday January 09, 2019 @04:15PM (#18868971)
The gyroscope is a datapoint that can be used for fingerprinting. Plus it gives quite a bit of information about you: whether you are lying down, sitting, walking, etc.
Re:Show HN: I taught my little brother JS, and he made this ... by tokyodude on Wednesday January 09, 2019 @11:54PM (#18871631)
doesn't this assume the user is walking around with the page open, the front tab, and the phone unlocked for a reasonably long period? which websites do I spend enough time on for that to be true? I don't generally walk and read
Re:Show HN: I taught my little brother JS, and he made this ... by colordrops on Thursday January 10, 2019 @01:15AM (#18871911)
Browsers now have service workers that run in the background even when the browser UI isn't loaded.
Re:Show HN: I taught my little brother JS, and he made this ... by saagarjha on Thursday January 10, 2019 @03:07AM (#18872313)
> I don't generally walk and read

That's how I spend 10-ish% of my time on Hacker News

Re:Show HN: I taught my little brother JS, and he made this ... by sgspace on Wednesday January 09, 2019 @04:11PM (#18868925)
How is this disturbing at all? Do you get disturbed that websites know your mouse pointer location?
Re:Show HN: I taught my little brother JS, and he made this ... by saagarjha on Wednesday January 09, 2019 @04:17PM (#18868982)
If the mouse cursor is outside the browser window, sure. Gyroscope data is relatively personal and not easy to modify, so it serves as a much better tracking tool than the mouse cursor.
Re:Show HN: I taught my little brother JS, and he made this ... by saagarjha on Wednesday January 09, 2019 @04:31PM (#18869126)
FWIW, Safari on iOS didn't ask me either. I'm actually kind of disappointed.
Re:Show HN: I taught my little brother JS, and he made this ... by jonathankoren on Wednesday January 09, 2019 @04:42PM (#18869232)
It worked just fine for me.
Re:Show HN: I taught my little brother JS, and he made this ... by zapzupnz on Wednesday January 09, 2019 @05:57PM (#18869886)
GP meant that Safari doesn’t ask for permission to use the accelerometer. In that sense, it can’t have worked just fine for you since Safari doesn’t have that as a privacy option.
Re:Show HN: I taught my little brother JS, and he made this ... by choward on Wednesday January 09, 2019 @04:30PM (#18869120)
My thought exactly. Totally surprised me. I thought the only inputs a web site could get from me from hardware without asking permission is key presses and cursor movement.
Re:Show HN: I taught my little brother JS, and he made this ... by nkrisc on Wednesday January 09, 2019 @02:30PM (#18867955)
Oh that's funny. I thought the block was always supposed to be falling because of the angle I hold my phone at.
Re:Show HN: I taught my little brother JS, and he made this ... by anonytrary on Wednesday January 09, 2019 @04:35PM (#18869172)
Good call. I'm impressed they implemented it that way. It's hard at first, but once I got used to the sensitivity, I found the mobile version of this game a lot easier to use than the desktop one.
Re:Show HN: I taught my little brother JS, and he made this ... by beatgammit on Wednesday January 09, 2019 @08:18PM (#18870697)
Yeah, that was super cool. I'm a little annoyed that you can't lose (red block goes away under 10 points), but it was way more fun on my phone.

In fact, I didn't realize that the gyro worked in both dimensions! I thought it was just a fast downward fall and it was actually hard to hit the red block since it kept moving. Then I found out you could lay the phone flat and slow the green block down and it was way more fun!

I like the concept and could see a more complete game making a ton of sense.

Re:Show HN: I taught my little brother JS, and he made this ... by dom96 on Wednesday January 09, 2019 @03:35PM (#18868567)
Indeed. Very cool concept.

I think it needs some sort of prompt about the tilting. Also the mechanism might need some calibration, I tested it with my SO and the tilting was too sensitive for her to control it accurately.

Re:Show HN: I taught my little brother JS, and he made this ... by alphakappa on Wednesday January 09, 2019 @11:41PM (#18871570)
Nitpick: It's not just the gyroscope. DeviceOrientation (at least on the iPhone) uses blends both the accelerometer and gyroscope (and if specified, the compass too)
Re:Show HN: I taught my little brother JS, and he made this ... by komali2 on Wednesday January 09, 2019 @07:25PM (#18870445)
Wooooah, that's why it was speeding around without any input from me! My laptop has a gyro in it as well that I forgot about!
Re:Show HN: I taught my little brother JS, and he made this ... by andyidsinga on Thursday January 10, 2019 @02:36AM (#18872189)
holy crap - works on my hp spectre 360 too! - i'm doubly impressed.
Re:Show HN: I taught my little brother JS, and he made this ... by daliusd on Wednesday January 09, 2019 @03:37PM (#18868591)
Note: mobile Chrome but not Firefox.
Re:Show HN: I taught my little brother JS, and he made this ... by Drdrdrq on Wednesday January 09, 2019 @03:53PM (#18868772)
Not sure what you mean, but it works for me on ff/android. Nice game, well executed!
Re:Show HN: I taught my little brother JS, and he made this ... by daliusd on Thursday January 10, 2019 @02:32AM (#18872168)
Maybe it was fixed :)
Re:Show HN: I taught my little brother JS, and he made this ... by PaulBGD_ on Wednesday January 09, 2019 @03:49PM (#18868726)
Worked just fine on Android Firefox.
Re:Show HN: I taught my little brother JS, and he made this ... by zrobotics on Wednesday January 09, 2019 @05:53PM (#18869849)
Worked excellent in brave mobile as well. Actually fairly addictive
Re:Show HN: I taught my little brother JS, and he made this ... by ronilan on Wednesday January 09, 2019 @01:54PM (#18867561)
Indeed.

This is awosome on mobile!

Re:Show HN: I taught my little brother JS, and he made this ... by scarejunba on Wednesday January 09, 2019 @02:31PM (#18867961)
Haha, took me a while to figure out that it doesn’t handle different screen rotations but once I did it’s quite neat how intuitive it is.
Re:Show HN: I taught my little brother JS, and he made this ... by KenanSulayman on Wednesday January 09, 2019 @02:39PM (#18868039)
The APIs powering this are in the process of being heavily restricted or removed altogether -- if you think games like this should exist, you should voice your concern here: https://github.com/w3c/deviceorientation/issues/57.
Re:Show HN: I taught my little brother JS, and he made this ... by snazz on Wednesday January 09, 2019 @02:43PM (#18868078)
It looks to me that they’re just adding a permission for gyro access instead of turning it off altogether. Did I misread it?
Re:Show HN: I taught my little brother JS, and he made this ... by KenanSulayman on Wednesday January 09, 2019 @02:44PM (#18868091)
Re:Show HN: I taught my little brother JS, and he made this ... by teraflop on Wednesday January 09, 2019 @02:46PM (#18868118)
That comment does not say the APIs are in the process of being removed.

And asking people to comment on the issue to say that they shouldn't be removed would not be helping the discussion, because that point has already been made in the thread by at least three people that I count.

Re:Show HN: I taught my little brother JS, and he made this ... by beatgammit on Wednesday January 09, 2019 @08:26PM (#18870737)
Since it's GitHub, just add a thumbs up or whatever to the comment in question, don't just add me too comments. That's the way I've seen voting work best in GitHub.
Re:Show HN: I taught my little brother JS, and he made this ... by zchrykng on Wednesday January 09, 2019 @03:55PM (#18868789)
If the app doesn't want to ask permission before gathering my data, they can pound sand.
Re:Show HN: I taught my little brother JS, and he made this ... by doodpants on Wednesday January 09, 2019 @04:24PM (#18869050)
It seems to me that gyroscope data is merely input, rather than personal data. In other words, I'm not sure asking permission before accessing gyroscope data makes any more sense than asking permission before accepting touch screen input. Or for desktop applications, asking permission before accepting keyboard/mouse input.
Re:Show HN: I taught my little brother JS, and he made this ... by saagarjha on Wednesday January 09, 2019 @04:32PM (#18869141)
Collecting gyroscope data is quite passive, though. It's easy to forget that an app/website has access to this.
Re:Show HN: I taught my little brother JS, and he made this ... by beatgammit on Wednesday January 09, 2019 @08:28PM (#18870750)
And it's also more concerning from a privacy perspective since it's the position of something outside of the app (the phone) instead of inside of the app. Mouse coordinates work this way (only get cursor updates within your browser tab content area), so it makes sense to require permission from the user before accessing it.