There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

OpenStars , in Always try sudo
@OpenStars@discuss.online avatar

Have you tried magic, like Kadorto?:-)

RedStrider , in Average CSS
@RedStrider@lemmy.world avatar

the userstyle experience:

Ephera ,

Yeah, userstyles are wild. You learn so many ways how to not use CSS. Everything is !important and rather than adjusting the HTML to change the structure, you get to do it all in CSS. 🫠

RedStrider ,
@RedStrider@lemmy.world avatar

flex-direction:row-reverse; my beloved

rushaction , in "No way to prevent this" say users of only language where this regularly happens - 07/01/2024

… the only language where 90% of the world’s memory safety vulnerabilities have occurred in the last 50 years

Yeah… That’s a shit post alright.

I’m not a C developer myself, but that’s just a low blow. Also, uncited ;).

5C5C5C ,

Yeah the only way it would be that high is if it lumps C and C++ together. But at that point it may be an underestimate.

verstra , (edited )

This is an overstatement, definitely. C is one of the few (mainstream) languages where memory safety vulnerabilities are even possible. So if you batch C and C++ together, they probably cover more than 90% of all the memory unsafe cove written in last 50 years, which is a strong implication that they will contribute to 90% of memory vulnerabilities.

All that said, memory vulnerabilities are about 65% of all high implact vulnerabilities on Chromium project^1 and about 70% of vulnerabilities at Microsoft ^2.

calcopiritus ,

So we’d only fix 70% of vulnerabilities by switching to rust? Not enough! Better keep writing C/C++!

veganpizza69 , in Trying to understand JSON…
@veganpizza69@lemmy.world avatar
veganpizza69 , in Surely "1337" is the same as 1337, right?
@veganpizza69@lemmy.world avatar

It’s the API’s job to validate it either way. As it does that job, it may as well parse the string as an integer.

JordanZ ,

deleted_by_author

  • Loading...
  • bleistift2 OP ,

    Or even funnier: It gets parsed in octal, which does yield a valid zip code. Good luck finding that.

    xthexder ,
    @xthexder@l.sw0.com avatar

    Well shit, my zip code starts with a 9.

    bleistift2 OP ,

    I’m not sure if you’re getting it, so I’ll explain just in case.

    In computer science a few conventions have emerged on how numbers should be interpreted, depending on how they start:

    • decimal (the usual system with digits from 0 to 9): no prefix
    • binary (digits 0 and 1): prefix 0b, so 0b1001110
    • octal (digits 0 through 7): prefix 0, so 0116
    • hexadecimal (digits 0 through 9 and then A through E): prefix 0x, so 0x8E

    If your zip code starts with 9, it won’t be interpreted as octal. You’re fine.

    xthexder ,
    @xthexder@l.sw0.com avatar

    Well, you’re right. I wasn’t getting it, but I’ve also never seen any piece of software that would treat a single leading zero as octal. That’s just a recipe for disaster, and it should use 0o116 to be unambiguous

    (I am a software engineer, but was assuming you meant it was hardcoded to parse as octal, not some weird auto-detect)

    docAvid ,

    It’s been a long time, but I’m pretty sure C treats a leading zero as octal in source code. PHP and Node definitely do. Yes, it’s a bad convention. It’s much worse if that’s being done by a runtime function that parses user input, though. I’m pretty sure I’ve seen that somewhere in the past, but no idea where. Doesn’t seem likely to be common.

    bleistift2 OP ,

    PHP and Node definitely do.

    Node doesn’t.

    
    <span style="color:#323232;">> parseInt('077')
    </span><span style="color:#323232;">77
    </span>
    
    1. If the input string, with leading whitespace and possible +/- signs removed, begins with 0x or 0X (a zero, followed by lowercase or uppercase X), radix is assumed to be 16 and the rest of the string is parsed as a hexadecimal number.
    2. If the input string begins with any other value, the radix is 10 (decimal).

    developer.mozilla.org/en-US/docs/Web/…/parseInt

    docAvid ,

    You seem to have missed the important phrase “in source code”, as well as the entire second part of my comment discussing that runtime functions that parse user input are different.

    bleistift2 OP ,

    You seem to have missed the important phrase “in source code”

    I read that, but I thought it was a useless qualifier, because everything is source code. You probably meant “in a literal”.

    bleistift2 OP ,

    I’ve also never seen any piece of software that would treat a single leading zero as octal

    I thought JavaScript did that, but it turns out it doesn’t. I thought Java did that, but it turns out it doesn’t. Python did it until version 2.7: docs.python.org/2.7/library/functions.html#int. C still does it: en.cppreference.com/w/c/string/byte/strtol

    xthexder ,
    @xthexder@l.sw0.com avatar

    Interesting that strtol in C does that. I’ve always explicitly passed in base 10 or 16, but I didn’t know it would auto-detect if you passed 0. TIL.

    kamen ,

    Oof.

    I guess this is one of the reasons that some linters now scream if you don’t provide base when parsing numbers. But then again good luck finding it if it happens internally. Still, I feel like a ZIP should be treated as a string even if it looks like a number.

    bitfucker ,

    Yep. Much like we don’t treat phone numbers like a number. The rule of thumb is that if you don’t do any arithmetic with it, it is not a “number” but numeric.

    sukhmel , (edited )

    Well, we don’t, but every electonic tables software out in the wild on the other hand…

    /jYes, I know that you can force it to become text by prepending to the phone, choose an appropriate format for the cells, etc, etc The point is that this often requires meddling after the phone gets displayed as something like 3e10

    raman_klogius ,

    Who tf decided that a 0 prefix means base 8 in the first place? If a time machine was invented somehow I’m going to cap that man, after the guy that created JavaScript.

    JackbyDev ,

    Should be like 0o777 to mimic hex 0xFF

    bleistift2 OP ,

    I refuse to validate data that comes from the backend I specifically develop against.

    Thcdenton ,
    TrickDacy , in Surely "1337" is the same as 1337, right?

    A string that represents types…

    RustyNova ,

    If a item can have different type, those label fields are actually quite useful. So I don’t see the problem

    NegativeLookBehind , in Stop use docker
    @NegativeLookBehind@lemmy.world avatar

    Kubernetes: I will ruin your fucking life

    SatouKazuma , in Derisking a project 1 year out

    Lol imagine having management that give a shit about anything but firing as many workers as possible to make themselves look better. Deloitte can suck my fat fucking balls.

    Jax ,

    A friend of mine works for Deloitte, can you tell me more?

    SatouKazuma ,

    Terrible pay (like wildly below market), shit PTO, meaningless work…

    ZeroHora ,
    @ZeroHora@lemmy.ml avatar

    I worked for a company that Deloitte had contracts with. I thought they were shit only in Brazil but it looks like they are worldwide.

    jaschen , in "Working with Gen AI" by Dandytoon

    From a person who does zero coding. It’s a godsend.

    RecluseRamble , (edited )

    Makes sense. It’s like having your personal undergrad hobby coder. It may get something right here and there but for professional coding it’s still worse than the gold standard (googling Stackoverflow).

    jaschen ,

    I know zero coding and trying to query something in snowflake or big query is basically not accessible to me. This is basically a cheat code for me.

    SparrowRanjitScaur ,

    Nah, you just need to be really specific in the requirements you give it. And if the scope of work you’re asking for is too large you need to do the high level design and decompose it into multiple parts for chatgpt to implement.

    lemmyvore ,

    If you were 100% specific you would be effectively writing the code yourself. But you don’t want that, so you’re not 100% specific, so it makes up the difference. The result will include an unspecified percentage of code that does not fit what you wanted.

    It’s like code Yahtzee, you keep re-rolling this dice and that dice but never quite manage to get the exact combination you need.

    There’s an old saying about computers, they don’t do what you want them to do, they do what you tell them to do. They can’t do what you don’t tell them to do.

    Bosht , in Derisking a project 1 year out

    I have experience with our PM and BAs throwing draft stories in mid sprint that required PO follow up. So basically a complete waste of time.

    ZILtoid1991 , in I'll have you know, my fork of a github repo has 3 stars 😎

    I have 10 followers on Github.

    github.com/ZILtoid1991

    Here’s my account if you want to also follow me. I might follow you back. Maybe we can even cooperate on some projects.

    passepartout OP ,
    @passepartout@feddit.org avatar

    Next level networking right here :D

    shield_gengar , in JavaScript
    @shield_gengar@sh.itjust.works avatar

    Just be better lmao

    RavenLuni , in How big is your desk?
    @RavenLuni@furry.engineer avatar

    @ZeroCool my desk is currently 52,572,500 miles long but I need a bigger one.

    Zip2 , in Old timers know

    Oh please, you didn’t even have to turn the cassette or floppy disc over. You and your luxuries.

    IndiBrony , in I'll have you know, my fork of a github repo has 3 stars 😎
    @IndiBrony@lemmy.world avatar

    I have 69 followers on YouTube. Where does that put me?

    pineapplelover ,

    You’re pretty much famous bro. Can I get your autograph?

    IndiBrony ,
    @IndiBrony@lemmy.world avatar
    passepartout OP ,
    @passepartout@feddit.org avatar

    On top of another person, or below if that’s your style. In any way, your head must face their genitals and other way round. Glad I could help!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines