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

help-circle
  • Code should absolutely speak for itself. But the occasional comment is still good to explain the ‘why’ of the code when the why isn’t very obvious, often due to a niche requirement. Also any time you have to break out a hack, that needs comments up the ass, what was the bug, what URL did you find the fix at, why does this hack work, etc etc. It’s very satisfying to go back and remove those hacks after they are no longer needed, often because the underlying technology fixed the bug that had to be hacked around.


  • Pentium D processors are pretty power hungry, so factor that into your thoughts. Also make sure you put a modern OS on it that is getting security updates. It probably has Win XP or Vista installed which isn’t safe to connect to any network.

    It should work fine as a router as long as you don’t enable any of the packet inspection features. For basic routing and firewalling for a home network it should be plenty powerful. I would personally put a small SATA SSD in it as the main drive and ditch the 90GB HDD.

    As an additional idea, if you put a larger SATA drive or two into it you could make it a NAS.


  • I have not personally experienced a dropout with a SMR drive. That is from the reporting I saw when WD was shipping out SMR drives in their Red (NAS) lineup and people were having all kinds of issues with them. According to the article (below), it sounds like ZFS has the worst time with them. WD also lost a class action suit over marketing these as NAS drives, while failing to disclose they were SMR drives (which don’t work well in a NAS).

    We want to be very clear: we agree with Seagate’s Greg Belloni, who stated on the company’s behalf that they “do not recommend SMR for NAS applications.” At absolute best, SMR disks underperform significantly in comparison to CMR disks; at their worst, they can fall flat on their face so badly that they may be mistakenly detected as failed hardware. Source



  • 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.


  • 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."]];