EnigmaticLion
Re:Ask HN: Did you encounter any leap year bugs today?
on Friday March 01, 2024 @01:58AM (#39559298)
Source is a lot more complicated than i thought it will be: https://github.com/rails/rails/blob/v6.1.7.7/actionview/lib/...
Re:Ask HN: Did you encounter any leap year bugs today?
on Thursday February 29, 2024 @08:49PM (#39557589)
We have a rails 6 app, and there's a test that essentially expects time_ago_in_words(1.year.from_now) to return "about 1 year" (as part of a user facing message). The test failed. I thought it's a flaky test but i was able to reproduce it locally. Turns out executing that code on a leap day returns "almost 1 year" instead.
Can test it in rails console if you are interested:
irb(main):001:0> include ActionView::Helpers::DateHelper
=> Object
irb(main):002:0> distance_of_time_in_words(Date.new(2025, 2, 28), Date.new(2024, 2, 29))
=> "almost 1 year"
irb(main):003:0> distance_of_time_in_words(Date.new(2025, 3, 1), Date.new(2024, 2, 29))
=> "about 1 year"
irb(main):004:0> distance_of_time_in_words(Date.new(2025, 2, 28), Date.new(2024, 2, 28))
=> "about 1 year"
Re:One night of telescope time rules out black hole/dark matter idea
on Monday April 08, 2019 @09:15AM (#19604859)
7 hours of observation, one image every 90 seconds: that's 280 images. My phone takes 8 megapixel photos and those are about 2 MB, based on that the 870 megapixel image would be about 200 MB. 200 MB * 280 = 56 GB. Doesn't sound that much.
Did they publish the images? I'm sure many astronomers would be happy to examine them.
Re:What Would Happen If There Were No Number 6?
on Wednesday October 25, 2017 @01:23AM (#15547705)
While reading the article i thought if there's no number 6, then the universe can't have more than 5 of anything. So perhaps 5 photons and that's it. There cannot be anything else because then there would be 6 objects in the universe.
Re:iTerm2: Please disable 'Perform DNS lookups to check if URLs are va...
on Wednesday September 20, 2017 @02:06AM (#15291188)
If i use iTerm's autocopy feature (e.g. that the selected text automatically goes to the clipboard) and rarely press CMD+C then i'm safe? Or should i start changing my passwords? Since i usually generate passwords with `pwgen`, then copy with double click.
Re:Hacking Slack using postMessage and WebSocket-reconnect to steal yo...
on Wednesday March 01, 2017 @12:38AM (#13761474)
Just out of curiosity, how long did it take for you to come up with this PoC? From the initial notice that something might be exploitable until you sent the email to slack?
Your post makes it look so easy, but it would surely take weeks for me to figure out all these things.
Re:Google Cloud Platform is the first cloud provider to offer Intel Sk...
on Saturday February 25, 2017 @09:38AM (#13731747)
That landing page is a whopping 9MB [1]. Please optimize it for users with slow internet like me.
[1] https://www.webpagetest.org/result/170225_RN_1K80/
Re:A list of all Android permissions
on Monday October 03, 2016 @01:09AM (#12625609)
Maybe i misunderstand what permission.INTERNET permission means, but i fail to see how Google Play Games is not using the internet.
Re:Ask HN: Is web programming a series of hacks on hacks?
on Monday September 12, 2016 @02:15AM (#12477575)
> "test".indexOf("st") == "test".length - "st".length
I don't think this is a correct implementation of "endsWith".
"testtest".indexOf("st") =/= "testtest".length - "st".length
Re:What typing ^D does on Unix (2009)
on Wednesday September 07, 2016 @01:37AM (#12441154)
Yes, but it is so annoying and confusing that these symbols are not printed on the actual keyboard. Looking at the keyboard doesn't help much when I try to press a shortcut I just saw in the menu.
Re:The Fake Factory That Pumped Out Real Money
on Monday July 18, 2016 @01:40AM (#12113397)
Source? This study says bicycling is way better than cars: http://bikeportland.org/2011/12/12/new-study-compares-bicycl...