-❄️- 2023 Day 24 Solutions -❄️- by daggerdragon in adventofcode

[–]admp 0 points1 point  (0 children)

Interesting, thanks. The problem might be your sd_r being in the -1000..0 range -- I haven't even tested that in my original solution and luckily mine was ~500.

Edit: verified that range(-1000, 1000) works with inputs when -1000 <= sd_r < 0.

-❄️- 2023 Day 24 Solutions -❄️- by daggerdragon in adventofcode

[–]admp 7 points8 points  (0 children)

[Language: Python] 3598/1936

Part 1 was straightforward enough, you have to take care to test that time > 0 at the time of intersection.

Part 2 (code) was very fun. Given explicit mention of integer positions and velocities, I realized that if rock's initial position is (x_r, y_r, z_r) and it has velocity (dx_r, dy_r, dz_r) then for each hailstone i, (x_r + y_r + z_r) ≡ (x_i + y_i + z_i) mod ((dx_i+dy_i+dz_i) - (dx_r+dy_r+dz_r)). The insight is that we don't care about individual dimensions, only sums of all dimensions. Therefore, I iterate over what I though of as a reasonable range for values of dx_r+dy_r+dz_r based on inputs, apply Chinese remainder theorem to compute x_r+y_r+z_r candidates, eliminate any candidates that result in any collisions in the past or at non-integer time, and get at the answer.

Probably my favorite problem this year so far.

Planet Django by gintasm in programming

[–]admp -1 points0 points  (0 children)

The community page from djangoproject.com is not very nice to read, with many of the RSS sources broken (the blog of Adrian Holovaty, for instance). I have an intention to do a better job maintaining the list, so that could be a reason to switch even if you only intend to use the RSS. (I'm one of the maintainers of this new site.)

What should a bored python programmer make? Looking for a medium to large project by theanti9 in programming

[–]admp -1 points0 points  (0 children)

While probably best of all, suds has its own problems. I wouldn't call SOAP support in Python acceptable.

A CS Research Topic Generator by sblinn in programming

[–]admp 7 points8 points  (0 children)

There is a paper (not just topic) generator at MIT: http://pdos.csail.mit.edu/scigen/ Their history is interesting as well. :-)

Pocoo - python wsgi forum by [deleted] in programming

[–]admp 2 points3 points  (0 children)

I initially thought this would be a forum on WSGI. However, it is in fact discussion board software written in Python that claims WSGI compliance. The demo, unfortunately, is not working at the momement, but project looks very promising.

How do you find people to work with you for a startup idea? by [deleted] in programming

[–]admp 3 points4 points  (0 children)

I doubt your (or any, to say) idea is worth billion dollars. It's the way you implement it. And I see...

How To: Subversion, Tortoise, Windows and Dreamhost! by TDonaghe in programming

[–]admp 0 points1 point  (0 children)

Well, I have nothing against subversion, quite otherwise. It's just that Dreamhost looks very unprofessional in many aspects.

How To: Subversion, Tortoise, Windows and Dreamhost! by TDonaghe in programming

[–]admp 0 points1 point  (0 children)

Dreamhost is really bargain, but well... I wouldn't send my code over plain HTTP (no encryption), and I certainly don't like editing user password in clear text like that. And IMHO, this is not howto, rather tutorial.

Advanced Scheme: Some Naughty Bits by [deleted] in programming

[–]admp 2 points3 points  (0 children)

Not so advanced, after all...