Steam on Linux also had this kind of bug once. Under specific circumstances an internal script returned a wrong value and then it recursively deleted all user-owned files on the filesystem.
"if (!false)" is just way funnier than it has any right to be and I'm not entirely sure why now excuse me while I do my best to forget the cursive code
I remember when i was 15 we had IT lessons in school and we had some basic programming lessons. During these i've been a bit more curious than others and been using more advanced codes (like arrays and combinations of other functions and such) to get the tasks done for which i was getting asked to NOT do that and do what teacher asked despite being credited for more effective solutions. Ones i've been looking through existed functions i found goto function (moves compilation process to the selected line, allowing to loop it and split the code into multiple pieces) that i found really usefull for todays task and used it like in half of the whole code. The face that teacher showed when he saw my code was so funny, especially when he literally called me "IT Criminal" After that incident i've started learning coding on my own at home while following teachers instructions instead of improvising and flexing with my skills
The comment //Pray to god this works reminded me of an assignment I had done last week and then I realized it was due in 10 minutes and hadn’t submitted it yet luckily I had it done so I just had to upload it. appreciate the save though!
BRANCHES?? Just call it "isEven" and return negation of x AND 1. (or "isOdd where you AND the argument with 1). And you don't even have to worry about any bits but the least significant. Literally cannot find a better way. There's no room for branches or any stupid stuff when you do it in a single clock cycle.
@@mr.rabbit5642 we're not returning true or false, we're returning a string with the word 'even' or 'odd', ya dingus. most likely slower than a naive branching approach tho because the "::" operator in the string index (i have no clue what language this is and haven't seen that operator) is almost certainly more expensive than a single branch.
@@nerdycatgamer Python and [num % 2:: 2] means start from index num % 2 (0 or 1) and go to the end (This is because there is a lack of number inbetween the two colons). Do it in steps of 2. Indexing works like: a[start:end:stepsize]
@@nerdycatgamer yeah I mean, true, but you can still wrap it into another function with ternary return isEven()? 'even' : 'odd'. Sure, call it a "branch" but it makes no difference, and using the :: operator implements like 30 branching operations within. And that all aside from the fact that often resolving unncecessary conditions is even worse, not only in the long run, than "branchless" return isEven()*'even'+(1-isEven())*'odd' I sure like the concept of branchless coding, but it's a myth in higher level languages. ESPECIALLY PYTHON, ya dingus :D
@@mr.rabbit5642 This is literally what my point was, what are you going on about? I literally said this 'branchless approach' is not going to be more branchless than a simple ifelse, and is going to probably be slower due to the user of the :: operator to iterate.' You were the one being incorrect by acting as if this function returns a boolean. Sure, you can wrap that boolean in a ternary and that being better... which is exactly what i said about an ifelse being better because of the overhead of the '::' operator.
This is actually pytest. There you can write stuff like "assert 2+2=5" and get "AssertionError: Actual: 4, Expected: 5". To get that output they had to botch the f*ck out of the assert statement, though. Something like: test_success = actual_value == expected_value assert test_success != False
There you go, I put the *:hover{ display: none } for the funnies and i couldnt stop laughing everytime i wanted to see the video and everything becomes bright white. 2 views for you madlad
I think what's funny is also that, if you look closely, the text is in italic where it was normal before, which is usually how GitHub Copilot and such suggest the end of sentences. So this was the Machine praying.
You know what I hate? The person who thought a whole calendar and clock interface would be easier to use than just typing in the date and time. Because that bullshit became the standard with no fallback on mobile to just enter the values as text.
it's to avoid format mixups, i've sometimes tried inputting dates in one format only to realize it wasn't valid cause the page expected a different one
Bro I have seen some where you can't change the year, you have to go MONTH BY MONTH. I'm pretty sure I saw one on the X sign up page. That's 336 clicks for me.
i would solve that by forcing iso format. type "20" and it will only let you type a number after, itll force the user to really look at the format hint 😊
0:46 Just had this happened to me as I was making the lowercase variable of a selectable race "lower_race". No problems there, even better with it being on a school computer.
That, kids, is why you always sand only the finest of type-safe languages. Sometimes I swear Python is designed to have as many footguns as possible...
"Trust us your account getting hacked was not because of our shitty app that has 10 year old OpenSSL version with literal billions of vulnerability statically linked and compiled with DEP disabled or because we transfers passwords encrypted with goofy ahh 64 bit key instead of hashes, it's because you didn't install our 'anti keylogger' which definitely isn't a kernel keylogger that causes kernel panic when you type faster than 0.5 wpm"
@@TheManinBlack9054no, Korean banking apps are actually that bad. They statically link openssl and proceeds to never update it, they wrote kernel keylogger easy as hell to tap into to prevent keylogging, said kernel keylogger introduces XSS, and the same kernel keylogger is easy as hell to crash and probably also equally easy to exploit Those garbages aren't "security app" they're literal backdoors Oh, also they don't have auto update so even when they fix some of the "vulnerability" (def not backdoor) there's no way for users to know At least they don't do these nonsense on mobile (more like they can't, I bet they would have done the same shit on mobile too if it was possible)
I once had to teach someone in my programming course (I was a student) how to write a database, because instead of a one to many table he created 20 extra columns and most were empty. We were about a week from the final project presentation.
I say on modern wide screens split the display of the code into columns. The actual code could be still just vertical but you get 2-3 screens worth of code, side by side.
That should be an IDE feature. The IDE would detect narrow pieces of code and automatically typeset them in two columns among longer lines displayed in a single column. So the underlying text would not change; just the IDE would present it in a different way.
@@matj12 I think it would be awful in practice. In the specific example they showed it might not look so bad.. but you have to consider all of the cases - there will be cases where there are some functions with a different widths than others (so the number of columns starts changing erratically), some functions with different heights than others where they don't line up neatly, and anything that causes the size of the window containing the code to change can cause the number of columns displayed to change (for instance, opening a search menu could cause this too which would get really frustrating in a lot of cases). I'm fairly certain it would just become a huge mess in practice and cause way more harm than good.
The Java one is horrendous, because you just have to use lombok, and put @Data to get getters and setters, if you want those. I'm a bit shaken and I need an(other) adult.
Programming is a lot like witchcraft. There are magical incantations that can be dangerous if used incorrectly, and everyone argues about how to write them.
No. First time there's no hope it will work, none at all. The first time is just spotting bugs. Now, if your code compiles and seems to work the first time over, this is a serious reason to worry and you should stop, and start analyzing the code in-depth because that means the bug is insidious, hard to detect and causes only occasional but catastrophic results
Yesterday I got a compile error saying I can't convert from type T to type T. It only came up after I ran my app, though. And the app ran just fine... 🙄
The git blame someone else is absolutely a war crime, but 0:51 is based correct filename (no alt text tho) Also nice end cards blocking the video and not a single source listed. Blocked and reported.
i found one yesterday: if(a == b == c) rather than if(a == b && b == c) the first one means that you are trying to compare a boolean with a number.....though the IDEA could probably understand this but still......the war crime