The right tool for the right job ¯\(ツ)/¯
- 0 Posts
- 7 Comments
Joined 1 month ago
Cake day: June 12th, 2025
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
Unittest in Python, enjoy! If you pass it with a function like the one in OPs picture, you have earned it.
import unittest import random class TestOddEven(unittest.TestCase): def test_is_odd(self): for _ in range(100): num = random.randint(-2**63, 2**63 - 1) odd_num = num | 1 even_num = num >> 1 << 1 self.assertTrue(is_odd(odd_num)) self.assertFalse(is_odd(even_num)) def test_is_even(self): for _ in range(100): num = random.randint(-2**63, 2**63 - 1) odd_num = num | 1 even_num = num >> 1 << 1 self.assertTrue(is_even(even_num)) self.assertFalse(is_even(odd_num)) if __name__ == '__main__': unittest.main()
FrederikNJS@lemmy.zipto Linux@lemmy.ml•Why does Arch seem to have a cult like following?1·11 days agoLast time I used EndeavourOS, I managed to get the graphical installer to install BTRFS on LUKS, it did require custom partitioning in the graphical installer, snapper just worked after that.
Zram (or was it Zswap?) was pretty easy to enable after installatiok
The bootloader might be beyond what the graphical installer can do though… I never really bothered switching…
FrederikNJS@lemmy.zipto Linux@lemmy.ml•Why does Arch seem to have a cult like following?1·12 days agoI gotta ask, what is it you want that the installer doesn’t provide?
FrederikNJS@lemmy.zipto Technology@lemmy.world•Trump social media site brought down by Iran hackersEnglish5·27 days agoThese DDOS for hire services make use of hacked machines as botnets to perform the DDOS attacks.
So while the people paying for the service didn’t hack anything, the people performing the DDOS certainly did.
I have been on Arch , and I’m now running NixOS as my daily driver… IMO NixOS is less of a hassle to set up, and nearly maintenance free compared to Arch… Twice a year when the channel updates there’s a bit of stuff, but every change I need to make is usually explained in the output of my
nixos-rebuild
… If something suddenly breaks in an update, I just boot into my previous generation, roll back myflake.lock
and wait a few days for a fix to be available…