5 ms·
GitHub search for 84600 seconds. Oops.
- Kiro 13y agoI don't understand.
- nycmattw 13y agoI actually don't understand either. Explain OP?
- ggreer 13y agoA day is 86,400 seconds.
- tantalor 13y agoSometimes.
- deleted 13y ago[deleted]
- squidfood 13y ago86,400 is the number of seconds in a day. This searches for the number of times a piece of code transposed the 6 and 4.
- Avalaxy 13y agoProbably the fact that there are 86400 seconds in one day and apparently lots of people typed 84600? Not really my sort of humor, but mmkay.
- ethann 13y agoThere are 86400 seconds in a day
- JosephRedfern 13y agoNumber of seconds in a day = 60 * 60 * 24 == 86400, rather than 84600.
- deleted 13y ago[deleted]
- rubiquity 13y agoThere will eventually be 84,600 replies to you telling you that there are 86,400 seconds in a day.
- deleted 13y ago[deleted]
- chubot 13y agoHaha, should be 86400, not 84600.
- tshaddox 13y agoI liked this one: SECONDS_PER_23_5_HOURS = 84600
- markcarlson 13y agoThat is a very common value to use when you want something to either occur a bit more than once a day, or time out in a bit less than a day.
- underyx 13y agoAnd to keep the discussion interesting, also, 12 seconds is a pretty popular timespan to use when you want something longer than 10, but shorter than 15.
- nkozyra 13y agoI certainly have some code that adds 86399 to encompass the entirety of the day. This is in languages I use with less robust date logic, of course.
- ggreer 13y agoIf there was an 84600 with no hinting variable names nearby, anyone reading would have trouble figuring out the author's intention. Any other number (say... 81234) would be unambiguous. In the words of Douglas Crockford, "All that you know about the code is that the programmer was incompetent."
- CanSpice 13y agoExcept it shouldn't, because when you have a leap second occur, suddenly you're off by a second. A day is a day, it's not 86400 seconds.
- 13y ago
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- akerl_ 13y agoHumorous as this is, it doesn't seem newsworthy. Maybe submit to The Daily WTF next time?
- elwell 13y agoI don't think it's right to judge someone just because they have 23.5 hour days. To each their own, I say.
- memnips 13y ago86400 seconds is 24 hours. It is surprisingly commonly mis-entered as 84600 seconds, as evidenced by this search. As such, many unintended consequences can ensue.
- tantalor 13y agoA day is not always 24 hours. http://en.wikipedia.org/wiki/Daylight_saving_time http://en.wikipedia.org/wiki/Daylight_saving_time
- fletchowns 13y agoBut 24 hours is always 24 hours
- afternooner 13y agoI believe more in a day having 24 hours than I believe in daylight savings.
- pkamb 13y ago`60 * 60 * 24`
- joshstrange 13y agoI wonder if Github will ever reconsider allowing bots [0]. There are bunch of things like this that would be cool to have pull-requests automatically generated for. Security fixes would be another place where I can see bots helping to fix common mistakes. [0] http://www.wired.com/2012/12/github-bots/ http://www.wired.com/2012/12/github-bots/
- XaspR8d 13y agoYeah, I'd love to help in some way, but the number of results is huge and without bots I'm discouraged from doing anything manually. Maybe we can create a resource of common typos in numerical constants that would auto-detect by edit distance? But I suppose most people willing to check a resource like that probably already double check their arithmetic. (That said, I've probably had this exact bug somewhere in my coding history, so no shame.)
- joshstrange 13y agoYeah, maybe the answer is a hybrid, bots that look for common mistakes and a website that lets people login to github and displays the potential fixes so they can fix the code in the browser and send the pull request. Like a way to try and introduce people to open source through guided fixes more or less.
- ejo0 13y agocheck out 48600 seconds for ruby, https://github.com/search?q=48600+seconds&type=Code&ref=searchresults https://github.com/search?q=48600+seconds&type=Code&ref=sear...
- grantismo 13y agoLooks like it's all coming from use of the tzinfo gem. See: https://github.com/tzinfo/tzinfo/blob/61fdd4359117e9a406c546bdc044a3e41faaa5d7/lib/tzinfo/offset_rationals.rb https://github.com/tzinfo/tzinfo/blob/61fdd4359117e9a406c546...
- Xylakant 13y agoeh - and what is that supposed to show? That there's roughly 13.000 projects that vendored a version of activesupport containing a file that allows converting "48600" to a rational value?
- j03w 13y agoI think that's timezone offset
- elwell 13y agoAnd none of them have any Stars: https://github.com/search?q=84600+seconds+stars%3A%3E0&type=Repositories&ref=advsearch&l= https://github.com/search?q=84600+seconds+stars%3A%3E0&type=...
- Steuard 13y agoHonestly, I think there's a little something to this submission beyond the "Ha ha, lots of people made typos that could cause big problems" factor. A public repository like GitHub makes checks for common errors like this really easy. Would it be feasible for GitHub or the community to automatically recognize broad classes of these likely errors and notify the authors? How sophisticated could that sort of tool become? Maybe "given enough bots, most bugs are shallow".
- wdewind 13y agoYes, in fact Amazon already does this. It will frequently warn you if your AWS keys are published in Github.
- joshstrange 13y agoI agree, it's too bad they banned bots [0], one alternative I see is: >> Yeah, maybe the answer is a hybrid, bots that look for common mistakes and a website that lets people login to github and displays the potential fixes so they can fix the code in the browser and send the pull request. Like a way to try and introduce people to open source through guided fixes more or less. [1] [0] http://www.wired.com/2012/12/github-bots/ http://www.wired.com/2012/12/github-bots/ [1] https://news.ycombinator.com/item?id=7717694 https://news.ycombinator.com/item?id=7717694
- markcarlson 13y agoMany of those are legitimately meant to be 23.5 hours, not 24 hours (TTL defaults, approximates for converting seconds to days, etc.)
- deleted 13y ago[deleted]
- Nickoladze 13y agoPeople can be stupid across a multitude of languages.
- leorocky 13y agoI don't think this bug is stupidity, otherwise we're all probably stupid.
- peterwwillis 13y agoDepends. There's probably 10x more PHP code on Github than any other language, so you're going to find 10x the common mistakes. It could be that there's a close-to-equal distribution of the same mistake among languages. (Though it doesn't help that PHP is probably used 10x more by inexperienced coders)
- Xylakant 13y agoIs it surprising you didn't take the time and test your assertion? The errors in the PHP files are mostly from a single package that gets bundled and checked in. The first 4 in fact. The last 43 pages are all in a single repo of data files (I can't figure out what they're used for, but hey, I don't need to know everything). I'm not a php coder any more, but at least blame php for it's actual faults, not for something pulled out of thin air.
- strommen 13y agoHN Challenge: name a scenario in which defining a constant as 86400 is better then defining it as (60 * 60 * 24). Or, are there languages where you can't declare a constant with a multiplication expression?
- sliverstorm 13y agoTo me it's a coding style thing. The argument for 86400 would be, too many operators makes things damn confusing. When your define expands in the preprocessor to a function sixteen operators long, you have made a mess.
- zemo 13y ago> are there languages where you can't declare a constant with a multiplication expression? obviously PHP. php > const X = 1; php > echo X; 1 php > const Y = 1 * 2; Parse error: parse error, expecting `','' or `';'' in php shell code on line 1 php > echo Y; Y
- mappu 13y agoFixed in the (upcoming) PHP 5.6. https://wiki.php.net/rfc/const_scalar_exprs https://wiki.php.net/rfc/const_scalar_exprs
- quaffapint 13y agoI find myself with pre-optimization issues on my new code and define constants multiplied out rather than add that .000000001% extra overhead of doing the multiplication - it's a sickness.
- wlievens 13y agoActually in all likeliness your compiler will do tgat for you anyway.
- Aaron1011 13y agoI first read this as 'Github search takes 84600 seconds'. Oops :)
- Xylakant 13y agoIt's actually not that many places where it's wrong: Anything from page 57 to 100 is one repo that does it consistently wrong: https://github.com/sconklin/solardata https://github.com/sconklin/solardata, then there's quite a few places that are partial matches only (seconds, but not 84600), there's quite a few places where it's a least not obviously wrong (page 38, where it matches on "PHI( 1) +6.18900e+05-7.84600e+05i Hz") and a ton of places that get copied around (the first pages are all bundled versions of the sonata cache interface).
- nkozyra 13y agoDisturbing enough that - despite having used 86400 a bazillion times (yes, literally) that it didn't look wrong at first glance.
- nperez 13y agoEven if you're using 86400, remember the possibility of leap seconds if you need absolute precision. Time makes my brain hurt sometimes.
- nicklovescode 13y agohttps://github.com/search?q=%22%3D+funtion%28%29%22&type=Code&ref=searchresults https://github.com/search?q=%22%3D+funtion%28%29%22&type=Cod...
- beagle3 13y agoEasy mnemonic: 60 * 60 * 24 = 864e2 (scientific notation). Take down 2 each time, and shove an e.
- oxplot 13y agoThis should never be entered like that. Not only it's prone to typos, it also requires a comment to accompany it. Since just about every compiler/interpreter folds constants, one should write it as 60 * 60 * 24 which would run without a performance hit.