• 0 Posts
  • 158 Comments
Joined 2 years ago
cake
Cake day: July 3rd, 2023

help-circle
  • Edit… I reread your comment and realized that python does it differently and that everything I typed was irrelevant… I’m still gonna leave it if anyone is interested in ternary expressions, but I suppose the answer to your question is, that’s just how python does it.

    That’s how ternary operators are designed to work. In essence, if you’re looking to do a single line if/then, you can directly assign a variable from the result of a ternary expression.

    As an example, I was scripting something earlier where there may or may not be a value returned from a function, but I still had to do something with that return value later. For this thing, I was using JavaScript.

    I ended up with:

    return platform == "name"  ? "Option 1" : "Option 2"
    

    If I were to write that out in a typical if/then it would be:

    if (platform == "name") {
        return "option 1"
    } else {
        return "option 2"
    }
    
    

    A ternary starts with a boolean expression, then the if true value, else the false value. That’s returned to either a variable or if in a function like my example, to the object calling the function. It’s just a way to write less code that in many cases is easier to read.


  • I’m not an old hat programmer and have never been forced to use VIM, but I started learning how to navigate because of the potential efficiencies that comes with it, and because I like to learn new things. I’m not good at it, but I’ve gotten a lot better, and I will continue to do so because it’s enjoyable, neovim is extremely customizable, and the vim key bindings can be used in vscode for when I use that. I also use Linux, so it felt like the right direction to go, but mostly for the memes.

    I don’t use it for high level language coding like python, JS, and definitely nothing.net related like c#, but it’s solid for lower level like C.

    You don’t have to enjoy it, but there are some extremely skilled programmers out there that can code laps around other extremely skills programmers just because they use vim/neovim and can navigate at a stupid fast rate. Watching some like the Primeagen on YT is humbling.



  • BassTurd@lemmy.worldtoProgrammer Humor@programming.devexit
    link
    fedilink
    arrow-up
    18
    arrow-down
    3
    ·
    10 days ago

    I have a vivid memory when I was in first grade and asked my teacher if I can use the bathroom, and I got his bullshit response. I was a first grader, so I sat my ass back down and held it. Fuck this horse shit mentality.

    Fine, if you’re an adult, it’s juvenile, but at that point people should understand the difference. Doesn’t mean I won’t lambast a MFer for being a pedantic prick though.


  • Low level programming skills in a low level language, C being the most popular. With memory safe languages like rust gaining more traction, C may eventually be a thing of the past, but imo, learning C will make you a better programmer in all languages because if you know C you know how everything works. Other than that, it could be something that uses a specific language like Arduino. Embedded programming is generally programming that interfaces with hardware directly, so really it’s just knowing how to program, and then doing it in a specific area.

    There’s a good book called Code: the hidden language of computer hardware that goes in depth of computer architecture and build up from there.


  • It took me 7 years to get a 2 year degree. I work with one of my best friends who got his masters in that same time. We’re both successful and excell at what we do. It does suck that you have to wait to be done, but one silver lining is you may have a better job market since you won’t be graduating with the vast majority of college students competing for the same spots.



  • If my personal laptop is stolen, my drive encryption will protect my data. Without that, physical access is enough to pull info unencrypted. A user password will prevent OS access both locally and remote. If someone happens to get my password or bypasses my login somehow, I don’t want them to be able to open my email and read messages, or open a browser, go to a logged in Amazon page, and be able to order items. I personally don’t keep anything logged in and everything logs out when my browser is closed. It’s inconvenient, but to the tune of an extra minute each day to login to everything.

    Really, you just have to decide your risk tolerance. Businesses have a lot at stake and therefore it behooves them to force strict auth policies. If you aren’t concerned about your personal stuff, set a login password if you want, and put your creds in browser, but I’d urge to at least use a password keeper over a browser.



  • I’m gonna have to disagree even though it is an annoying process listed above.

    In this case there was a drive encryption password to prevent data theft if the device is stolen, OS login for user level access, a password keeper login at the application level, and MFA on a different app. That is 5 different auths (drive, os, pw keeper, email, MFA) for 5 unassociated objects managed by potentially 5 different entities. The only reason this was an issue was the dead phone for MFA, which is a user error. It super sucks that this is best practice because of bad actors, but this is baseline auth.

    I am curious how you would do this differently though if you’ve got ideas. In this case, assuming the OS is Windows and email is Outlook, this could have all been handled with SSO, which would have only required the first two passwords, which is my daily work experience. However, I then get into Bitwarden and log into any not SSO apps I need and have MFA configured for all that support. I work remote a lot and my company is looking at an always VPN connection for everything. That would require me to go through another level or two of auth.


  • I was a carry-out at my local hardware store for a few years in college. I brought carts in from the corrals and helped people load heavy stuff. I’ve seen and been victim to the damage caused when a rogue cart catches the wind and fucks off down the parking lot. People that leave their cart not in a corral or inside disgust me more than more most lazy people.

    You’re my hero, dude.




  • Not shilling for Dyson, but I’ve had two over the past 10 years, and we only sold the first one because we wanted to get some money for it before it maybe stopped working, and we bought a new one on Black Friday. Nothing ever broke, maintenance is easy, the ball really is easy to steer, and they are effective. My only gripe is that with our carpet pile, the suction is too much and I had to modify a little to make it run better. I don’t know if it’s a design flaw, because my carpet isn’t that thick, but I was able to find forum posts with people having the same issue. It could also just be a, we got the wrong model, situation.

    My next vacuum, hopefully years down the road, will be a Miele. I just need to start setting cash to the side to it hurts less when I need to do it.




  • I learned on automatic but got a manual about 5 years ago. This past November I went on a trip with friends and we were able to rent a manual car for cheaper because I could drive one and it was the norm in the country we were in. Nice skill to have, but not required. I’d learn manual if you have the option.



  • You’re never too old to make new friends. I’m mid 30’s and started a new job in a different city last year. Just talk to people casually, say good morning, ask how they are, just simple pleasantries. I haven’t hung out with these people mostly because of living proximity, but I’m chummy with most, we play some games together, and I think we enjoy each other’s company. I have little doubt that if I asked to hang out or grab a drink, people would do so if available. Most of these people are 5-10 years younger, so we do have a gap in life experiences, but I’ve found that the age gap matter less the older I get. I can give wisdom and tell stories of my life and their lives kind of make me feel a little younger again.

    As someone that has just been screened for ADHD and waiting for my follow-up, I feel like I can relate to your experience. A lot of what you said resonates with my life other than the coke and Xanax. The weed is real, and unfortunately, the booze for me. I’ve gone through plenty of introspection and have identified places where I know I can be a turd friend. I noticed how I was negative a lot, and have taken conscious steps to not burden my friends. Don’t get me wrong, we’ll piss and moan about things, but I had to make the effort to be better. I’m not good and time estimating no matter how confident I am. If I’m meeting with people setting times, I will for sure over estimate what I think is right so I don’t make people wait. Really, my wife has been extremely invaluable in my adult life, and I’d probably be in a much worse place if not for that support.

    I say all of this because as I think that you know, not all all negative actions are intentional or sometimes even recognizable when you’re doing it. I’ve lost sleep over saying the wrong thing or doing something that is a minor inconvenience because I feel so guilty. I feel like from your story, that maybe your friend has issues and isn’t intentionally screwing you. To parrot one of the other posts, I would say talk to your buddy about things that bother you. Don’t come in hot or anything, just ease into it. Anyone that is a real friend will listen to your concerns and at least try to make an effort. Some people are blind to their issues and maybe just needs someone to help them out.

    Best of luck my dude. It’s tough out there and I hope you find your way through this one. Don’t be afraid to meet new people.