petersr

joined 11 months ago
[–] petersr 23 points 6 days ago (1 children)

Let me take a stab at it:

Problem: Given two list of length n, find what elements the two list have in common. (we assume that there are not duplicates within a single list)

Naive solution: For each element in the first list, check if it appears in the second.

Bogo solution: For each permutation of the first list and for each permutation of the second list, check if the first item in each list is the same. If so, report in the output (and make sure to only report it once).

[–] petersr 10 points 6 days ago

Sorry, we sold out of that 5 min before you walked in.

[–] petersr 1 points 6 days ago

They came for the dogs first and now us

[–] petersr 27 points 1 week ago

Well, I guess PDF has one thing going for it (which might not be relevant for scientific papers): The same file will render the same on any platform (assuming the reader implements all the PDF spec to the tee).

[–] petersr 9 points 1 week ago (1 children)

Welcome to Denmark.

[–] petersr 2 points 3 weeks ago

From ChatGPT:

Me: Water exits a nozzle at coordinate (0, 1.7m) and hits the ground at (2m, 0). Assume the water exits the nozzle at 90 degree (i.e. straight to the right). How can we determine the speed of the water?

(here I made some rough assumptions based on the image, and assumed that her feet were at (0, 0)

Answer: The speed of the water exiting the nozzle can be determined using the principles of projectile motion.

  1. Determine the time of flight:

    The water is projected horizontally from a height of 1.7 meters and hits the ground at 2 meters horizontally. The vertical motion is governed by the equation: [ y = y_0 + v_{y0} t - \frac{1}{2} g t^2 ] Here, ( y_0 = 1.7 ) meters, ( v_{y0} = 0 ) m/s (since there is no initial vertical velocity), and ( g = 9.8 ) m/s² (acceleration due to gravity).

    The water hits the ground when ( y = 0 ): [ 0 = 1.7 - \frac{1}{2} \times 9.8 \times t^2 ] Solving for ( t ): [ 1.7 = 4.9 t^2 ] [ t^2 = \frac{1.7}{4.9} ] [ t = \sqrt{\frac{1.7}{4.9}} \approx 0.59 \text{ seconds} ]

  2. Determine the horizontal velocity:

    The horizontal distance covered is 2 meters. Since horizontal velocity ( v_x ) is constant (there is no horizontal acceleration), the distance can be given by: [ x = v_x t ] Here, ( x = 2 ) meters and ( t \approx 0.59 ) seconds: [ v_x = \frac{2}{0.59} \approx 3.39 \text{ m/s} ]

Therefore, the speed of the water exiting the nozzle is approximately 3.39 m/s.

[–] petersr 5 points 3 weeks ago (1 children)

What velocity does the milk exit the nipple with to be able to have that trajectory?

[–] petersr 4 points 3 weeks ago (1 children)

Stuxnet would like a chat with you

[–] petersr 5 points 4 weeks ago* (last edited 4 weeks ago) (1 children)

Can we at least avoid a dystopia future?

[–] petersr 3 points 4 weeks ago (3 children)

But can we at least get him out the election?

[–] petersr 15 points 1 month ago (1 children)

Don't be evil, you know.

[–] petersr 1 points 1 month ago

I hear ya. But to be honest, what they are doing here is fine, and doesn't seem malicious. There is an Open Document specification and they stick to it, but the spec doesn't enforce everything. For instance for the ordering of certain elements on the page, I bet you they store store those elements in memory in an efficient data structure where ordering doesn't matter, so when writing out the memory to disk, the easiest for them to do is just write it out in what order it appears in their data structure.

But there are probably other cases where they are not so innocent.

view more: next ›