• 0 Posts
  • 1.2K Comments
Joined 3 years ago
cake
Cake day: June 30th, 2023

help-circle

  • Python code:

    results = {}
    for ip0 in range(256):
      ip0_str = to_str( ip0 ) + '.'
      for ip1 in range(256):
        ip1_str = ip0_str + to_str( ip1 ) + '.'
        for ip2 in range(256):
          ip2_str = ip1_str + to_str( ip2 ) + '.'
          for ip3 in range(256):
            ip_vector = [ ip0, ip1, ip2, ip3 ]
            ip_str = ip2_str + to_str( ip3 )
            results[ ip_vector ] = ping( ip_str )
    

    Might look a bit nicer using format strings instead. That map will contain on the order of 4 billion entries (one for each value of 2³²), and the actual size will depend on what format the ping function returns, 4 bytes for each key (optimized from my initial version that used the IPs as keys), plus all the internal structures for the map like key hashes and the hash table itself. Ie, this takes more memory to run than viewing OP’s full sized image and I wouldn’t suggest running it with less than 32GB of RAM. Though it would take less memory if it generated the image directly or at least making the keys implicit (which the image does, as they are encoded into the x, y coordinates rather than stored).

    Edit: Let’s look at runtime, too, because why not. Assuming every single IP responds in 0.01 seconds (they’ll take longer, especially the ones that time out instead of respond), rounding the total to that nice 4 billion number get us 40 million seconds. An hour is less than 4000 seconds, so it would take over 100 hours to run this script.

    Though it could be parallelized, since you can ping many targets at once. Not sure what the maximum number of pings you could have in flight is, but whatever it is, you’d be much better off using a script that did like 80% of that (to leave some margin for the rest of the system to use, also ISPs might not be happy with you maxing out your ICMP traffic).



  • I mean, it’s a binary: either you like it or you don’t (plus the neutral option). The ratings in the meme were portion of people who liked it and didn’t. So you will either always fall with the majority or minority (or won’t care if you feel neutral about it). There is no wildly inaccurate for that, there’s just how many others you agree or disagree with.

    Assuming their sample population is representative, at least, because what it says about the population can be inaccurate (but “my friend group all agrees with the minority side” doesn’t necessarily mean it’s inaccurate for the pop since your friend group probably doesn’t represent the entire pop).








  • Yeah, that’s what I was thinking. I’ve fixed a bunch of electronics myself over the years, from rebending the metal in my logitech G7 when the click stopped behaving right to replacing the switch outright on my G900 when it started doing the same thing, to fixing the stick drift on my PSVR2 controller after I accidentally threw it across the room, to fixing a strummer that would stick on a 3rd party guitar controller. Each of those was a bit different but all pretty straightforward and saved me a bunch of money.

    The part that makes me hesitate is that each of those were done at my own risk. I had to retire the G7 after one attempt to fix the button resulted in dropping the tiny plastic part on carpet, losing it forever. That was fine because it was mine and like the 3rd or 4th time I fixed it. But if I’m doing it for someone else, then I won’t necessarily be able to just write it off as a loss if something breaks in the process. I might start out by buying broken items cheap, fixing them and selling them so the risk (and decisions about rasolution) is still all just on me. Or maybe letting people bet against me as an insurance. Like pay an extra $5 or something and if I break it, I’ll pay you $150.









  • Major things for me are the rise of kernel anti cheat (revolutions don’t have to be good), and the rise of linux gaming–both the steam deck and linux gaming in general (the solution to both MS and a passive prevention of kernel level bs). Around 2015, barely any games ran on linux, but today most do unless they have that kernel level anti-cheat or the makers specifically wanted to exclude linux users.


  • Could also just say something like, “I’d love to deal with this but first need to write a rust program from scratch that can import or export any file format, converting content as necessary, with a custom GUI written in godot and the interface between the GUI and backend will be a new serial communications format optimized for this wire hangar I plug in to a random port on my PC (which changes every time to avoid being tracked) that acts as an antenna to communicate with an antenna on a custom N64 cartridge where the backend is running (required to meet audit standards). My boss pays me by line of code, so I’d like this solution to be optimized for the maximum possible lines of code so I can retire and buy lots of what you’re selling. Oh also, if there’s even a single reference to JSON, XML, or CSV, my boss will instead fire me (though we DO have to support all of these formats for import/export). Can you help with this first real quick?”