first off he died from tuberculosis. and he thought it was all a dream because Polka reminded him of his sister who he lost and he knew he was on his death bed so he thought it was him trying deal with it at long last
however his spirit had been transferred to another world and after he's fought at the end he finally realizes the "dream world" is real and he had made a huge mistake to let Polka die. when he dies in our world his composes one final piece that was inspired by Polka which he also plays in the other world to save her if i remember correctly
@SaintWacko just saw this on the star board, clicked on it forgetting steam been blocked at work and when i saw "blocked" in the url, i misread it as "black" and i was just thinking "god dam it not again"
If it works, it works... But a lot of folks seem to think using trees or recursion is way too complex. Again, reminds of the broad range of experience of people writing these.
I was activating some Steam keys I got from a game bundle when Steam threw an error:
There have been too many recent activation attempts from this account or Internet address. Please wait and try your product code again later.
I've waited a few minutes but I'm still getting the error. How long ...
It also should work fine with duplicate relative paths
but lol at the idea that it's more readable I'm still not fully sure, well, I guess folder size is the size of everything that fully contains the absolute path
Or it could be the size of all the files plus the size of all the subdirectories
oh, now it all makes sense. For part 1 you were supposed to do an inside out search which would set you up for part 2, but the outside in search makes much more sense algorithmically since you visit every point exactly 4 times.
(And actually, there are ways to short circuit that by stopping after you find the first 9 in line for a given direction)
Just some optimization stuff on yours, your visible from top/left should have started from the point immediately to the top/left and worked your way out.
At that scale, it could be the difference between mathematical and boolean operations. One thing I remember from my compilers class is that since boolean && and || can short-circuit, they effectively have to be compiled into if statements that take multiple instructions. Mathematical operations on the other hand can be one instruction that takes one cycle, which could also potentially allow for further optimizations.
Here is a piece of C++ code that shows some very peculiar behavior.
For some reason, sorting the data (before the timed region) miraculously makes the primary loop almost six times faster:
#include <algorithm>
#include <ctime>
#include <iostream>
int main()
{
// Generate data
const unsig...
@MBraedley Well, the problem statement doesn't say that you can assume anything about the distribution, and the example input looks pretty random to me.
@Nzall There's also stuff like instruction reordering. Short circuiting guarantees that later cases will not be processed if the short circuit happens, so instructions have to go in a very specific order. With multiplication on the other hand, everything is always processed so the compiler has the freedom to reorder instructions more and possibly do further optimizations as a result.
Here's the thing: modern CPUs are actually cheating and looking ahead in the code and executing stuff in advance, because if they need to wait for the next instruction to finish, it's needlessly delayed. Problem is that branching code often leads to code being ran that doesn't need to be ran, causing further delays. Using code that doesn't branch means the CPU can just keep executing code at maximum pace
@Unionhawk I might be mistaken, but considering console.write() calls require the processor to wait for a previous result and thus can't be short circuited or executed out of order, that can lead to the entire code slowing down
@Unionhawk "execute out of order" means also starting up the next instruction processing before you've fully finished the current one. Essentially, modern CPUs have 4 steps for every instruction they execute, and they keep each step occupied all the time. if you have an IO statement that uses the result of the previous line, it needs to finish that previous line before it can start the IO statement processing