Man, i used to name the variable that held the maximun with "min" and the one that held minimun with "max" just to fuck with whoever was grading my code
0:17 actually makes sense. This is sometimes used to force hardware acceleration on an element by giving it a tiny amount of depth. Very useful when you have a 2D element that then becomes 3D through an animation of some kind.
@@haniyasu8236 it's usually going to be much faster to assume something is 2D unless specified otherwise, and I wouldn't trust developers to correctly specify. This is fine in my book.
So, this is why my laptop can't run 2d games that look simpler then my file manager. Somebody "assumed" that it would be faster if my integrated gpu will do 3d instead of 2d graphics. Thank you very much.
That's exactly it. When an element moves from having a transformon it to not, it changes the rendering and makes the edge aliasing look different. Sticking a low translate Z on elements that will have translate on them at some point works around that.
Actually though, last I heard, his code was pretty optimized, and the game only ran like shit because of rendering load from random things having way too high poly counts and time being spent rendering things that were behind walls relative to your viewport.
@@shred1894 "his code was pretty optimized" That statement alone gives me motivation to open his buggy mess of a game in DnSpy and see if he actually optimized something.
@@shred1894 Time isn't the only metric by which you evaluate code. It needs to be readable, documented, and well structured to make additions to the project simple. Probably why yandev is so slow at developing the game. His lack of knowledge regarding the switch statement is just a simple example of how truly lost he is.
@@viktor8986z7o Re-read my comment because I wasn't using time as a metric for anything. I was saying that it was rendering things that weren't in view, which when paired with high-poly-count objects, can result in poor framerates.
0:54, I immediately recognized which program this was made for. It was created to test the program we developed for our semester project at the Slovak Technical University
i remember the sonic team back when sega was an actual competitor to nintendo have done something to the likes of 1:20 when they've had to present a mostly functional demo that had to have a fast framerate and don't crash, they've made the fps counter do exactly that and whenever the game would've crashed it would go back to the menu to continue their presentation. it worked flawlessly despite 1 or 2 "crashes" happening during the presentation.
1:40 omg I recognize that one, brings back so many memories. This blueprint was actually for an upgrade shop system, where the branches are actually a giant else/if chain checking for every upgrade id than applying it along with repeated nodes for checking the player's balance and deducting from it. I only found it while browsing the project looking for an unrelated bug and figured I would share this blueprint by a colleague when I saw it (no NDA was in place). To this day I don't blame him though. the crunch was insane. I still have the UE project somewhere on my pc.
Two things: First, as someone completely self taught with little to no hope of ever landing a job, I'm proud I understood about half of these. Second, I'm proud I've made optimized versions of SEVERAL of these.
0:54 ... comments are in Slovak and extremely (un)helpful: 0: terminate program 1: reading of pre-defined map 2: way there and back 3: 5 princesses 4: test for ideal walk-through 5: dragon does not exist 6: princesses do not exist 7: princess unavailable (and functio... 8: killing of dragon unattainable within time limit ..... (stihnout=to make in time, nestihnutelné=can't be make in time ... english does not have word for this?) 9. test 100x100 map, 3 princesses 10. 100x100 with one princess 11. pillar/column
Let me play a lawyer: 0:05 Can be very useful. Compiler does not scream about unhandled cases. No break point needs to be added explicitly. 0:17 Described above. 0:51 If you use obfuscation it may be important to note not to use reflection. But in this case it’s about reversed engineering attack. 1:21 This line can be useful to guarantee game simulation determinism. Not optimisation though.
@@r.t.5767 I can see how this particular instance is a joke but it's what developers actually do :/ Just months ago I played a unity game and complained about bugs to the developer, turns out it's because of my 144 Hz monitor - the game was only ever tested on 60 Hz and is meant to run at 60 fps (scaling by deltatime is too hard). So the dev just locks it to 60 frames in the next day's patch.
@@SyedAshrafulla `assert(false)` is actually quite useful to mark 'unreachable code'. In debug mode a message is emitted, and you can figure out that your unreachable code is maybe not that unreachable after all.
1:51 inpt = input rehnj (レンジ = microwave) = range number = int(inpt()) ru = 0 for i in rehnj(2, 2**number): nn=f'{i:b}'.count('1'); ru+=all(nn%ji for ji in rehnj(2, int(nn**0.5)+1)) and nn>1 inpt(ru)
0:00 Fun fact: In my final year as a software dev student, a friend of mine wrote his code exactly like this. He worked for the same 1-man-company in both of his internships, which was run by an old man who had done some Pascal in his youth and never touched programming again. Told him in his interview "Just write this program I want, and if it compiles at the end of your internship I'll give you an A". I tried to convince him the entire year that this was probably not the most optimized way of doing this, but he refused to see reason. 1:50 Fun fact 2: At the company I work at now, one of our clients writes all of their code in Mandarin Chinese or something. When I still did tech support, the same dev kept contacting me with screenshots of his code and I kept telling him that I can't help him, because I don't speak Chinese (he did speak a little broken english, which is why we were somewhat able to communicate), but he never understood why I couldn't read his code. People in tech support, get the f out of there, preserve your braincells like I did.
Security through obscurity is actually how most modern locks work. It's extremely easy to break or pick most locks but we are protected by purposeful suppression of information
0:55 is much better when you understand the comments; princess not exist, journey there and back, dragon not exist, loading the map, princess not available, not enough time to kill dragon...
If true = false. Lets think about this logically. Wouldn't the fact that true = false itself be false but again something that is false is true. Makes my head hurt. It would mean something is factually inaccurate and completely inaccurate that the same time.
I legit thought it was a code along of a game called war crimes. However, what I got was not disappointing at all. If anything, this was one of the most relatable videos I have ever watched.
@@tPlayerioT That's thanks to the fact that Case and Break statements don't actually use any computing power to resolve - as opposed to extremely hungry If statements.
What does that last program do? I've been staring at it for a while and I can't figure it out. It's very slow for n>20. Currently working on optimizing it so I can plot the output.
The algorithm has a time complexity of O(2^n), so each increment of n by 1 more than doubles the execution time. Maybe this pseudo-code helps: x = 0 for each integer i in [2, 2^n): k = number of 1s in the binary representation of i increment x if k is not a multiple of any integer j in [2, sqrt(k)]
@@TheZombieKillerWhale This is fairly easy to solve, but it's mostly a math problem not a cs problem. First, the most 1s that a number up to 2^n could have is n, so we need to find all primes up to n. Then, for each prime p, we can count the number of primelovers with p 1s by calculating (n choose p). So the number of primelovers up to 2^n is just sum((n choose p) for p
I got one: constexpr int operator”” true () { return 0; } constexpr int operator”” false () { return 1; } If you don’t know the operator “” is used to define literals. ‘true’ and ‘false’ are Boolean literals, so we’ve redefined them to be the opposites, but also they’re integers now and not just boolean values.
0:00 Honestly I'll rather have this than some wacky inheritance stuff, you could obviously add smth like function pointer but It does it's job and is readable.
@@else1f Well, I guess I should've specified the language, for me I am learning C, so I don't know what that is and I don't think C has anything similar.
Shit like 1:10 happens when you are programming untill midnight and you can no longer think properly. You try to run it. It doesn't work. You say "fuck it" and go to sleep. The next morning you revisit it and find that.
0:31 there is no need for if check before for each loop, also in method getValue there is no need to create varible called result, you can just return what functions give.