« first day (4529 days earlier)      last day (503 days later) » 

12:11 AM
@Fredy31 it's actually not a dream
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
 
12:26 AM
Should there be a separate tag for the Steam version of Dwarf Fortress since it's got a totally different graphical pack/UI?
 
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
 
Or is it fine to ask a question about the new version with the existing tag, which doesn't seem to mention the new Steam version or specify
 
is it just the appearance that's changed in the Steam Version of Drawf Fortress?
 
I believe the menus have changed. It also lacks adventure mode currently
I don't know the particulars yet of if it's a completely different build or not
 
i'd probably go with the original tag but just make mention in the question the version your playing
if the versions are significant enough, someone will likely raise a meta question on it on what text to use for the tag
 
12:31 AM
@TylerH This is a question best brought to Meta. I'm not familiar enough with the differences between the two to give an informed opinion.
 
@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"
 
 
2 hours later…
2:44 AM
See what I mean, ha.
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.
 
 
3 hours later…
5:21 AM
If I had taken more time I could have written a cleaner implementation
 
 
4 hours later…
9:01 AM
This certainly looks very familiar
 
9:13 AM
I suppose I should get out of bed and write this one up.
 
 
2 hours later…
11:05 AM
I wrote a class for today's problem, @Wipqozn would be proud
3
 
 
2 hours later…
12:39 PM
@Ronan <3
 
12:51 PM
2
Q: How long do I need to wait before I can activate Steam keys again?

StevoisiakI 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 ...

 
 
1 hour later…
2:19 PM
@Wipqozn oh I see, a dictionary of absolute paths
I mean that's basically a tree
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
 
2:53 PM
Meanwhile
The prompt was "write a function to calculate the area of a circle commented in the style of donald trump"
it also generates pretty good Senator Armstrong speeches
 
3:21 PM
I'm sure there was an easier (and more concise) way of doing today's puzzle.
 
3:56 PM
Ugh. I'm really going to miss having access to Pandas today
 
 
1 hour later…
5:20 PM
Ah, crap
Today's is the first one where my part 1 solution is really not helpful for part 2
 
Yeah, I had to rewrite it for part 2, it was good for checking the logic though
 
5:56 PM
Man, part 2 was a lot more fun
Part 1 I built a map of which trees were visible from the outside by scanning each row
I was lazy and instead of writing code to scan the columns as well, I just rotated the dataset and the visibility map and ran the row scan again :P
 
I just built mine as an int[,] and did some for loops
I wonder what the compiler does with multidimensional arrays
does it just make an int[][] probably
probably
 
I really missed pandas and numpy
 
Oh nope IL does retain it as int[,]
neat
 
6:13 PM
@SaintWacko I was tempted to do that, but I just took the hit in cache performance. Still ran fast enough.
I could probably pull out a bit of part 1 into a lambda to reduce code duplication, but that's not going to measurably improve anything.
 
I'm not going to worry about effieciency until we get to the days where a unoptimised solution take hours to run
 
Yeah, even my super naive JS solution was fast
 
I was actually surprised that my solution was effectively instant. I'm iterating over every tree and checking each direction.
 
@MBraedley Same
 
Yeah, I did that too. N just isn't very large here
 
6:22 PM
Yeah, we're not far enough into December to need really clever solutions
 
huh, I'm a little surprised the input is 99x99 instead of 100x100
 
I didn't even look at the dimensions
 
@MBraedley That is a lot of lines
 
Yeah, there's definitely ways to simplify it (part 1 I could replace the if blocks with a lambda)
There, reduced some of the code duplication. It's now slightly shorter :P
 
7:28 PM
I broke out some functions because it seemed like the right thing to do but it became longer
I can probably combine some of them
In fact why am I looking left or right when I can look across the entire row or column in one fell swoop in part 1
Wait no I can't
I sort of can but it'd be dumb
You'd have to like, check if it found anything in the middle of the loop and at that point it should probably be two functions
 
7:59 PM
@Unionhawk I had 2 outer loops that each had 2 inner loops for part 1.
basically, for each row, look from the left and then from the right, then for each column, look from the top then from the bottom.
 
8:19 PM
Yeah I had uh
For each x, y look in all directions
 
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)
 
For outside-in, don't you have to do some extra work do avoid double/triple/quadruple counting trees in the different directions?
 
8:34 PM
@murgatroid99 No, I just threw the coords in a set then output the size of the set at the end.
 
OK, I would describe managing a separate data structure as extra work
 
@SaintWacko I think your part 2 is subtly wrong. Trees on the edge should have a scenic score of 0.
@murgatroid99 The standard library is managing that for me
 
I mean, your code is creating and populating the set
 
Yeah. If visible, insert the coords into the set.
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.
 
I don't think it matters if you start from the edge and go inward vs going outward from the point
I mean, the numbers are randomly distributed, so a blocking tree is just as likely to be closer to the edge as to be closer to the point
 
8:47 PM
@murgatroid99 you also don't need to do this since the dataset is sufficiently small
 
@Wipqozn @Memor-X Thanks. I'll ask about it. at some point in the next few days if I remember.
 
But hmm
 
@Unionhawk Not sure what you mean
 
I mean it still runs in less than 0.1s (part 2 less than 0.01s)
But I am probably doing extra work that could be eliminated
Also I'm still not sure why my part 2s are pretty consistently an order of magnitude faster
I even tried to move the Console call outside timing and it was the same
 
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.
 
8:58 PM
Which would make sense this week if it was the other way around
Since the one that should theoretically be able to short circuit is slightly slower
 
@murgatroid99 They're not fully random, there's a bit of a pattern to them
 
@Unionhawk No, that's what I mean: short circuiting might actually be slower because of what optimizations are available or not available.
 
Wait, I think I got an SO question that's about this
26757
Q: Why is processing a sorted array faster than processing an unsorted array?

GManNickGHere 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...

 
I see
 
@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.
 
9:06 PM
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
Yeah, that too
 
In any case, that it's been consistent across all days is weird
But when we consider that computers are weird it checks out I guess
I should try pulling my console write call out of timing on all of them and see what happens
That's the only thing that makes sense, that a second console write call might be faster than the first by a little
 
@murgatroid99 Taller trees are concentrated closer to the center
 
I mean makes sense to generate it that way
 
@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
 
@MBraedley If it's not in the problem statement I consider it coincidental
 
9:13 PM
I mean yes in synchronous C# I expect things to execute in order ish
Besides I have to get the final value somehow
 
@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
 
Which can only happen after usually my foreach(var line in input) happens
 
In any case, we're still solidly in my <0.5s rule
So it's all good
I wonder what these will do on my framework though lol
Probably fine on, what is it
i5 10600 or something
vs 5600X
Probably a bit slower but not a lot
 
9:32 PM
Reminder: The Game Awards start in about 3 hours
 
9:49 PM
Oh shit the Keighley show
Pog can't wait for Immortality to not win best performance
Also everyone in here should play immortality but heed its content warning
Buy it now, check the warning, if it sounds too intense refund it
 
 
1 hour later…
11:18 PM
''''
if tree is None:
self.tallest[direction] = None
return self.height
''''
whoops
>
if tree is None:
self.tallest[direction] = None
return self.height
bah
point is
it took me way, WAY too long to figure out my bug here... which is that instead of returning sef.height... I was returning None
Where Tree is a neighboring tree
 
Worked on the sample input of course, because bugs like this always do, ha
 
@Wipqozn Oh man, those are the worst
 
@SaintWacko Yup. IT happened since I changed how the function worked part way through, and then just missed it.
 

« first day (4529 days earlier)      last day (503 days later) »