• 0 Posts
  • 14 Comments
Joined 2 months ago
cake
Cake day: July 2nd, 2025

help-circle

  • It’s a great tinkering language. Which is a lot of what I do for personal projects no one else will ever see. I find it’s biggest strength is also it’s biggest weakness. It’s really easy to write that you assume you don’t have to care about under the hood stuff.

    But something as simple as using a list instead of a set can turn a 2 minute script into a 2 hour script pretty quickly.

    I remember when I first started using it I was working with building a list and then comparing elements of another list to see if it was contained.

    My list was static in the comparison so I just did a “x in Y”.

    Y was massive though.

    If I was using any other language I would have thought about the data type more and obviously use a set/hash for O(1) lookup. But since I was new to python I didn’t even think about it because it didn’t seem to give a fuck about data types.

    A simple set_a = set(list_a) was all I needed. I think python is so easy to pick up that no one even bothers to optimize what they are writing. So you get even worse performance than it should have.


  • wheezy@lemmy.mltoProgrammer Humor@lemmy.mlPython!
    link
    fedilink
    arrow-up
    16
    ·
    edit-2
    9 days ago

    Was a personal project. But absolutely. Half my job is trying to explain why something is taking so long when in reality I actually it’s already done I just don’t want to do nothing for the next few days.

    Managers never really know. And other engineers don’t care. It’s all about balancing expectations.


  • wheezy@lemmy.mltoProgrammer Humor@lemmy.mlPython!
    link
    fedilink
    arrow-up
    98
    arrow-down
    1
    ·
    edit-2
    9 days ago

    I know people joke around about this a lot. But I was blown away by a recent switch to I did from using cv2 with python to using cv2 with C++.

    I had literally hundreds of thousands of images to analyze for a dataset. My python script would have taken 12 hours.

    I ported it to C++ and it literally destroyed it in 20 minutes.

    I’m sure I was doing something that really wasn’t optimized well for python. I know somewhere in the backend it probably was using a completely different library with multi thread optimization. Or maybe turbojpg is just garbage in python. I’m still not even sure what the bottleneck was. I don’t know enough to really explain why.

    But holy shit. I never had that much of a performance difference in such a simple task.

    Was very impressed.


  • Well, not entirely. There are cases for which a person utters the wish and it is not counted. “I wish for a million wishes!”

    The standard is for the genie to explain the exceptions but not count that as a wish.

    Now, it could decrement the count after this check. But just decrementing the count before verification would be sloppy.

    But, then again, basic verification would also include checking that wishes_remaining <= MAX_WISHES.

    Which, I think is a pretty standard check for genie’s. Given that that constant has remained at 3 since their beta days and exceptions are thrown for violations of this rule.


  • Literally just had the same thing happen to me. This time at Microsoft. Worked for a small startup. It got bought out in 2023 after investments in actual hardware that wasn’t named Nvidia died.

    Layoffs on most of our engineers. Somehow I survived and basically did no work for 2 years. Was finally laid off.

    I hated it. But I basically stole a salary from Microsoft for two years. Fuck these big tech companies.



  • Oh man. You should see the source code for IOS (the Cisco one not Apple).

    Spent 5 years working on it out of college. I think it’s the most cursed code base you can imagine.

    Not necessarily because of the massive struct defs everywhere. They are kinda needed when you’re running an entire OS as basically a set of interacting Linux processes pretending to be an OS.

    At some point Cisco realized they could not compete without putting a Linux kernel as their base. So they basically just copy and pasted the old code written in the early 90s for the IOS and put it into a set Linux processes.

    To be clear. It’s not just the front end. They didn’t really change the code much from the old IOS. Its a cluster fuck of interprocess communication hacks that probably seemed like a good idea at the time.

    It is a massive pain in the ass to code because you’re basically doing everything on the Linux kernel and then frustratingly have to write the CLIs for IOS just so Cisco can continue to sell their proprietary OS with some of the most unnecessary hardware locks. Massive learning curve for any new engineer.

    Literally, no one on the entire switching team knew how to send a message from a specific process to the IOS process. I had been assigned something that needed it. So I somehow figured it out and was “the guy” for that for the time I spent there.

    Fuck. I’m gonna start ranting more if I go any further. But yeah, sometimes you need a massive struct because some idiot decided that forcing a closed source CLI on the market is a good idea for profits.

    Definitely not a good idea for coding. But you learn quickly that no one actually cares about good code in this industry. There is no time for it. There is no reason for it. Just spit out garbage until it works and your manager won’t care.

    If you want clean code. Go write an open source project or a personal project.




  • I did a “rm -rf *” in the wrong directory today.

    I got the absolutely beautiful “argument list too long” in return.

    I had a backup. But holy shit I’m glad the directory had thousands of files in it and nothing happened. First time I got that bash error and was happy.

    I usually have rm aliased to “trash” or whatever that cli based recycle bin is. But just installed a new OS and ran this on a NAS folder today by mistake.


  • wheezy@lemmy.mltoSelfhosted@lemmy.worldgoodbye plex
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 month ago

    I’ve heard people had luck with Tailscale playing nicely with non Plex options. I can’t say I’ve tried it. Though I do use Tailscale. Essentially if you setup Tailscale for Grandma it’ll be like she’s sitting on your local network. Even better, set it up on her router and you can literally debug all her Internet problems if you can ping it.

    Beyond that a raspberry pi with a battery backup on a 4G subscription connected to the router. That would be the ultimate “grandma” setup. Connect her router/modem power to remote power cycle. But I digress.


  • wheezy@lemmy.mltoSelfhosted@lemmy.worldgoodbye plex
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    For some reason I get permission errors on jellyfin every time I use it. Never with Plex. I’ve gone through the steps to fix it before. But when you change your shit as much as I do. I just stay with Plex because it’s plug and play. And I have the pass. I don’t have the time to fuck with stupid shit with jellyfin.