• 12 Posts
  • 202 Comments
Joined 1 year ago
cake
Cake day: June 9th, 2023

help-circle
  • BombOmOm@lemmy.worldtoProgrammer Humor@programming.devLife Hack
    link
    fedilink
    English
    arrow-up
    87
    arrow-down
    1
    ·
    3 months ago

    Assuming the accounting system this thing links with both does not protect from SQL injection attacks (many don’t, despite it being easy to protect against) and also has a table named “Bills” with a field named “amount”; what this would do is go through every single Bills record and half the value in the amount field. This would completely fuck the system, particularly when it came to billing and tax filing as the numbers for accounts billing and receivable wouldn’t even come close to matching each other. The accounting department would have a hell of a time fixing the damage.


  • Since the health is a float, yeah, it can create issues. A health of 0.000000001 is greater than zero, but that would almost assuredly be displayed to the user as simply 0, causing player confusion. The easiest solution is to have health and damage always be integers. A less great solution is to use a non-floating point decimal format. If such doesn’t exist in your language, you can emulate one by having health and damage both always be integers, but move the decimal point over, say two points, when displaying to the user.


  • I’m still annoyed with how verbose Objective-C is. Just check out what one has to do to create and concatenate a string. Madness:

        NSString * test = [[NSString alloc] initWithString:@"This is a test string."];
        NSString * test2 = [test stringByAppendingString:@" This value is appended."];
    

    And god forbid you want to concatenate two things to a string:

        NSString * test3 = [test1 stringByAppendingString:[test2 stringByAppendingString:@" Adding a third value."]];
    

  • For inflation rates over 4%? In the US, likely no more than another year or three. There were a ton of inflationary pressures between COVID handouts, the Russian invasion of Ukraine curtailing wheat and oil exports, and Yemen attacking global shipping. The first is over already, the second is being worked around, and the third is not going to last a huge amount of time.

    For Turkey, good luck to them and their hyperinflation. They managed their economy like shit.

    For Germany, probably going to be longer, they were too tied to Russian gas and they were forced to sign expensive long-term contracts to secure LNG. Though, they are buying increasing amounts of nuclear power from France, which is easing their LNG requirements.

    For Russia, probably as long as the sanctions last. So as long as they continue their invasion of Ukraine.

    For everyone else? No clue, I’m not familiar enough with their monetary and political processes.