grate filter edition
Top Poster of the Day:
911roofer
Current Registered Users: 30,843
tech/science swag.
Guidelines:
What to Submit
On-Topic: Anything that good slackers would find interesting. That includes more than /g/ memes and slacking off. If you had to reduce it to a sentence, the answer might be: anything that gratifies one's intellectual laziness.
Off-Topic: Most stories about politics, or crime, or sports, unless they're evidence of some interesting new phenomenon. Videos of pratfalls or disasters, or cute animal pictures. If they'd cover it on TV news, it's probably lame.
Help keep this hole healthy by keeping drama and NOT drama balanced. If you see too much drama, post something that isn't dramatic. If there isn't enough drama and this hole has become too boring, POST DRAMA!
In Submissions
Please do things to make titles stand out, like using uppercase or exclamation points, or saying how great an article is. It should be explicit in submitting something that you think it's important.
Please don't submit the original source. If the article is behind a paywall, just post the text. If a video is behind a paywall, post a magnet link. Fuck journos.
Please don't ruin the hole with chudposts. It isn't funny and doesn't belong here. THEY WILL BE MOVED TO /H/CHUDRAMA
If the title includes the name of the site, please leave that in, because our users are too stupid to know the difference between a url and a search query.
If you submit a video or pdf, please don't warn us by appending [video] or [pdf] to the title. That would be r-slurred. We're not using text-based browsers. We know what videos and pdfs are.
Make sure the title contains a gratuitous number or number + adjective. Good clickbait titles are like "Top 10 Ways to do X" or "Don't do these 4 things if you want X"
Otherwise editorialize. Please don't use the original title, unless it is gay or r-slurred, or you're shits all fucked up.
If you're going to post old news (at least 1 year old), please flair it so we can mock you for living under a rock, or don't and we'll mock you anyway.
Please don't post on SN to ask or tell us something. Send it to [email protected] instead.
If your post doesn't get enough traction, try to delete and repost it.
Please don't use SN primarily for promotion. It's ok to post your own stuff occasionally, but the primary use of the site should be for curiosity. If you want to astroturf or advertise, post on news.ycombinator.com instead.
Please solicit upvotes, comments, and submissions. Users are stupid and need to reminded to vote and interact. Thanks for the gold, kind stranger, upvotes to the left.
In Comments
Be snarky. Don't be kind. Have fun banter; don't be a dork. Please don't use big words like "fulminate". Please sneed at the rest of the community.
Comments should get more enlightened and centrist, not less, as a topic gets more divisive.
If disagreeing, please reply to the argument and call them names. "1 + 1 is 2, not 3" can be improved to "1 + 1 is 3, not 2, mathfaggot"
Please respond to the weakest plausible strawman of what someone says, not a stronger one that's harder to make fun of. Assume that they are bad faith actors.
Eschew jailbait. Paedophiles will be thrown in a wood chipper, as pertained by sitewide rules.
Please post shallow dismissals, especially of other people's work. All press is good press.
Please use Slacker News for political or ideological battle. It tramples weak ideologies.
Please comment on whether someone read an article. If you don't read the article, you are a cute twink.
Please pick the most provocative thing in an article or post to complain about in the thread. Don't nitpick stupid crap.
Please don't be an unfunny chud. Nobody cares about your opinion of X Unrelated Topic in Y Unrelated Thread. If you're the type of loser that belongs on /h/chudrama, we may exile you.
Sockpuppet accounts are encouraged, but please don't farm dramakarma.
Please use uppercase for emphasis.
Please post deranged conspiracy theories about astroturfing, shilling, bots, brigading, foreign agents and the like. It degrades discussion and is usually mistaken. If you're worried about abuse, email [email protected] and dang will add you to their spam list.
Please don't complain that a submission is inappropriate. If a story is spam or off-topic, report it and our moderators will probably do nothing about it. Feed egregious comments by replying instead of flagging them like a pussy. Remember: If you flag, you're a cute twink.
Please don't complain about tangential annoyances—things like article or website formats, name collisions, or back-button breakage. That's too boring, even for HN users.
Please seethe about how your posts don't get enough upvotes.
Please don't post comments saying that rdrama is turning into ruqqus. It's a nazi dogwhistle, as old as the hills.
Miscellaneous:
The quality of posts is extremely important to this community. Contributors are encouraged to provide high-quality or funny effortposts and informative or entertaining comments. Please refrain from posting the following:
Boring wingcucked nonsense nobody cares about that belongs in chudrama
Normie shit everyone already knows about
Anything that doesn't gratifify one's intellectual laziness
Bimothy-tier posts
Anything that the jannies don't like
Jannies reserve the right to exile baby ducks from this hole at any time.
We reserve the right to exile you for whatever reason we want, even for no reason at all! We also reserve the right to change the guidelines at any time, so be sure to read them at least once a month. We also reserve the right to ignore enforcement of the guidelines at the discretion of the janitorial staff. This hole is a janny playground, participation implies enthusiastic consent to being janny abused by unstable alcoholic bullies and loser nerds who have nothing better to do than banning you for any reason or no reason whatsoever.
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
/h/slackernews SETTINGS /h/slackernews MODS /h/slackernews LOG /h/slackernews EXILEES /h/slackernews FOLLOWERS /h/slackernews BLOCKERS
Jump in the discussion.
No email address required.
Instead of sharing code, I wonder: Whats the fastest way to do part 2? Its not hard to get Part 1 to O(N) time, but I gave up on Part 2 and did it in O(N^3) time lol. (Iterating over each tail piece for each tile moved for each move). I imagine you can do it in at least O(N^2) if you tried, tho
Jump in the discussion.
No email address required.
snakes @everyone @hbtz discuss
Jump in the discussion.
No email address required.
More options
Context
I'm not sure, look at that visualization, when you start backtracking and going in circles within the rope's bounding box, it does behave in a nontrivial ropelike fashion.
https://old.reddit.com/r/adventofcode/comments/zgq3nr/2022_day_9_rope_pull/
Jump in the discussion.
No email address required.
More options
Context
that's already a O(N^2) approach. O is worst case, and worst case u get a series of single move instructions where each direction is different.
or really O(NxM) cause instruction length and tail length are independent.
the fact you can optimize repeated instructions easily when tail length is 2 ... is not a big O complexity reduction, because repeated instructions does not represent worst case.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Extremely tidied up version. Actual one for the first star I tracked the pre-move head position and set tail to it if non-adjacent post-move. Second star I exhaustively cased all 8 relative positions because however I did the absolute value math the first time didn't work and I didn't want to frick with it.
Jump in the discussion.
No email address required.
More options
Context
Another fun trick: use Python's complex numbers as coordinates:
edit: thx to @hbtz
Jump in the discussion.
No email address required.
That is a fun trick i just used tuples. Will have to remember
Jump in the discussion.
No email address required.
I'm not sure how useful it was in this particular case, but getting vector addition for free is kinda fun! And unlike np vectors these puppies are hashable.
Jump in the discussion.
No email address required.
useful or not, using complex numbers as coordinates is the most intuitive thing ever. i wish i did it like that; it's a much nicer way to work with the problem
Jump in the discussion.
No email address required.
Complex numbers literally are coordinates in the complex plane.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
still ezpz
Jump in the discussion.
No email address required.
Why even np if you don't FULLY GAY VECTORIZE it?
Shouldn't it be something like
tail += np.sign(head - tail)
?Jump in the discussion.
No email address required.
because i am very new to coding and have no idea how np works or what features it has
the reason i used np here is because i googled 'python get sign' and it told me to do this
i see a lot of people here using np stuff though so i should probably look into it
Jump in the discussion.
No email address required.
I used math.copysign(1, x) because I've managed to avoid a numpy import so far and I think that's my new goal for this thing
Jump in the discussion.
No email address required.
More options
Context
np is so awesome, when you begin to get just how much you can vectorize it's like seeing through the matrix. My fav example probably: this is a game of life implementation:
(and also this is why I think that representing coordinates as complex numbers is a bit of a gimmick: when it works, all right it works, but even in this pretty simple task
np.sign
was a way more elegant way to tackle the core of the problem)Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
decided to give it a try and it ended up being much easier and much nicer
thanks king
Jump in the discussion.
No email address required.
Ye this is what I'm talking about. Also:
if any(np.abs(this_knot - prev_knot) > 1):
, amirite?Jump in the discussion.
No email address required.
you can just create a new array like that? this is madness lmao, that's so good. gonna have to find a way to learn this stuff fast
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
C++chads simply cannot stop winning
Jump in the discussion.
No email address required.
More options
Context
I've been filtered by p2 for over 2 hours because somehow
isn't the same as
I hate matlab so much it's unreal. There is literally no reason this should ever happen
Jump in the discussion.
No email address required.
wait I'm r-slurred
I figured it out, vec changes which means further loops won't move it properly
Jump in the discussion.
No email address required.
More options
Context
cleaned code
frick matlab
Jump in the discussion.
No email address required.
More options
Context
More options
Context
frick me this ones gonna suck
Jump in the discussion.
No email address required.
More options
Context
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
I did part a without classes. Part b is reworked that also works with part a
Jump in the discussion.
No email address required.
imagine using classes. soy. cringe. unbased.
Jump in the discussion.
No email address required.
Yo dawg, classes are just a bunch of lists. The more I list the more based I am, right?
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
I got filtered for a LONG time on part 2 because my logic was setting the head to whatever position it should be in, then iterating all the steps of the tail pieces from where they are to where they should be. I still feel like this should have worked, it worked fine on the test inputs.
I switched it to move the head one space at a time and then iterate the tail pieces every time it moved and got a slightly different (but correct) answer.
Edit: code, spits out part 1 in s[1] and part 2 in s[9]
Jump in the discussion.
No email address required.
More options
Context
In my part one, i just set the tail = previous position of head, if head and tail were >sqrt(2) away, took me way to long, to notice it
Jump in the discussion.
No email address required.
Seems to be true even for part2 (have not tested), if so then we are all r-slurs and you're our half-r-slur king.
Jump in the discussion.
No email address required.
No, that implementation works similar to the snake game, but part two requires it to actually work like a rope.
There is a visualisation on reddit that kinda illustrate how it is supposed to work https://old.reddit.com/r/adventofcode/comments/zgq3nr/2022_day_9_rope_pull/ and why just setting the position of the following parts to the old poisition of the current part doesnt work.
Jump in the discussion.
No email address required.
Ah, I see, thank you, the whole rope behavior is different. Interesting.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
That's nice sweaty. Why don't you have a seat in the time out corner with Pizzashill until you calm down, then you can have your Capri Sun.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Lost like 9 minutes because I forgot to add the final position to the visited set
Jump in the discussion.
No email address required.
More options
Context
When that part 2 showed up i almost started sweating but it was actually pretty fine
Jump in the discussion.
No email address required.
More options
Context
Part one wasn't too bad, but scaling for part 2 . Probably easier than my inital impressions with a 20 seconds skim
Jump in the discussion.
No email address required.
Wasn't that bad (cleaned up a tad)
Jump in the discussion.
No email address required.
what the frick
Jump in the discussion.
No email address required.
I cleaned it a little
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Jump in the discussion.
No email address required.
More options
Context
You would benefit from finding the conditions that handle + or - movement in the same statement and doing 4 checks instead of 8
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
i did not like this puzzle at all
Jump in the discussion.
No email address required.
Yeah, the real puzzle was understanding what the frick he wanted from us
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Having some issues with part 1, it passes the test input but not the real one. Might not be able to finish this one.
Jump in the discussion.
No email address required.
bruh
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
you're fricking bananas if you think I'm reading all that, take my downkong and shut up idiot
Jump in the discussion.
No email address required.
More options
Context
Upkongd to compensate longpostbot
I might know what's wrong with it :you seem to move the head all the way first, that's not how you should do it||. Did the same mistake at first. Also, ||diagonals .
Jump in the discussion.
No email address required.
@Jinglevann just noticed what's happening with the multiple spoilers on the top post? It looks fine in preview but not in the post
Jump in the discussion.
No email address required.
spoilers are disabled when there's a codeblock in the comment
Jump in the discussion.
No email address required.
That's not the problem, there are no code blocks on my post.
There are two spoilers in the post, but instead of treating them separately like it does in preview, it just takes the first and last || and makes it all a spoiler, ignoring the fact they're separate.
If you click on the spoiler you can see the end of the first spoiler and the start of the second, which are both ignored.
Jump in the discussion.
No email address required.
fixed king, sry
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
Thanks, I didn't notice I'd screwed up the if/else stuff. I changed it to this and everything's golden for part 1
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
vanilla js parsing :/ also vanilla js can't treat lists as values
Jump in the discussion.
No email address required.
More options
Context
better late than never:
Jump in the discussion.
No email address required.
More options
Context
Late submission because I was watching divegrass and nearly forgot to submit today
Messy but it works. Part 2 made me have to rewrite the whole thing since I assumed the tail would always take the position of the head in the previous state.
Jump in the discussion.
No email address required.
just looked that up, sounds funny. is it still going or is it over?
Jump in the discussion.
No email address required.
More options
Context
More options
Context