Jump to content

Robin Hood investing app forgets to check for leap year

Cobiskuit

RIP my SPY puts

Resident Mozilla Shill.   Typed on my Ortholinear JJ40 custom keyboard
               __     I am the ASCIIDino.
              / _)
     _.----._/ /      If you can see me you 
    /         /       must put me in your 
 __/ (  | (  |        signature for 24 hours.
/__.-'|_|--|_|        
Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Ecchi said:

I can't believe they didn't count for  a leap year... Bad design.

Coding things like leap years, leap seconds, time zones and the likes is a major pain in the ass.

Bad design, sure, but a pretty understandable oversight.

Link to comment
Share on other sites

Link to post
Share on other sites

If (current Year %4 = 0)

Days Add 1 day? 

 

Don't know the entire code but doesn't seem like adding such checks overall is hard

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, Cobiskuit said:

Article that shows app is down, later cites bug

Reddit bug screenshot here

 

I for one find this hilarious. Thoughts?

(Mods let me know if this doesn't belong here)

Your thread doesn't follow the Tech News posting guidelines, so it was moved to the General section.

 

If you want your thread moved back, please edit it so that it follows the guidelines ;

 

If you need help with your forum account, please use the Forum Support form !

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, DemiGod said:

If (current Year %4 = 0)

Days Add 1 day? 

 

Don't know the entire code but doesn't seem like adding such checks overall is hard

You would need to add two more check to that, since leap years isn't just "is the year divisible by 4?".

If a year is divisible by 100, it is NOT a leap year (like the years 1800, 1900, etc.). Unless then again a year is divisible by 400, then it is a leap year (like 1600, 2000, etc.).

 

So the check needs to look a little like this:

if(((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
{
	YearIsLeapYear = true;
}

Not keeping in mind those two extra rules would only result in an error in the year 2100, which may seem far away.. But so was the year 2000, when programs were still working with two number year formats.

But that still does not account for leapseconds, different timezones (like half hour or quarter of an hour timezones), etc.

 

In these sorts of circumstances it's probably best to just use a library which includes all this stuff and rigorously check (unit test) it for your purposes.

 

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

well that's another reason to stay clear of robinhood it seems, especially after this imgur post I saw a couple days ago

Spoiler

My system is the Dell Inspiron 15 5559 Microsoft Signature Edition

                         The Austrailian king of LTT said that I'm awesome and a funny guy. the greatest psu list known to man DDR3 ram guide

                                                                                                               i got 477 posts in my first 30 days on LinusTechTips.com

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×