Re:Show HN: 10-minute programming challenge. Let's do more o...
by snippyhollow on Wednesday August 08, 2012 @07:14AM
(#4354943)
For my daily (walking) commuting, it says 2.4km, which is right, for 24k to 33k steps, which is wrong: that's <= 10cm steps. It's one order of magnitude away from the truth.
[ Parent
| on HN ]
Re:Show HN: 10-minute programming challenge. Let's do more o...
by pud on Wednesday August 08, 2012 @07:19AM
(#4354955)
Is it possible you're reading it wrong?
I just put in a 2.4km address and it came out to ~2,500 steps.
See this permalink (click "go")
http://missstep.com/?origin=Clayallee%209%2014191%20Berlin,%...
Re:Show HN: 10-minute programming challenge. Let's do more o...
by subsystem on Wednesday August 08, 2012 @08:04AM
(#4355079)
Localization issue:
var miles = prettyDistance.replace(",","").replace(/[A-Za-z$-]/g, "");
Re:Show HN: 10-minute programming challenge. Let's do more o...
by snippyhollow on Wednesday August 08, 2012 @08:16AM
(#4355120)
I don't think I'm reading it wrong. Your link gives me:
"The fastest route is 2,4 km, which will take approximately 24,855 to 33,140 steps if you walked it."
Re:Show HN: 10-minute programming challenge. Let's do more o...
by tantalor on Wednesday August 08, 2012 @09:34AM
(#4355435)
Are those metric steps or imperial?
Re:Show HN: 10-minute programming challenge. Let's do more o...
by nemetroid on Wednesday August 08, 2012 @12:58PM
(#4356628)
It's doing some text parsing on the "pretty text" returned by the Google Maps API instead of using the provided distance in meters, and it's probably failing due to some localisation issue. It strips "," from the text, maybe your locale uses "," as a decimal separator leading to the distance being parsed as 24 km?