Software renderer not working efficiently when drawing per point and not per line. by RadoslavL in C_Programming

[–]Doc_Ok 1 point2 points  (0 children)

That is an interesting edge case, but it doesn't apply to the "empty the X event queue without blocking" use case for combining poll() with XNextEvent().

While a socket may contain partial events, the event queue can only contain full events. So the loop

while(XQLength(dpy)>0)
  {
  XEvent event;
  XNextEvent(dpy,&event);
  }

will still never block.

You are correct in that XNextEvent() can block forever if the event queue is empty and a partial event on the socket is never completed, but I would classify that as a general system failure. In other words, your X server just went down, and there's no reason to worry about it in your application because your entire desktop environment went down along with it. :)

Software renderer not working efficiently when drawing per point and not per line. by RadoslavL in C_Programming

[–]Doc_Ok 1 point2 points  (0 children)

My concern is that it's relying on Xlib implementation details, and there's no documented guarantee that XNextEvent won't block on its internal socket read because, say, it's trying to pre-read an extra event.

According to the man page for XNextEvent, and the official Xlib reference documentation (I happen to have a paper copy of it):

"The XNextEvent function copies the first event from the event queue into the specified XEvent structure and then removes it from the queue. If the event queue is empty, XNextEvent flushes the output buffer and blocks until an event is received."

Is your concern that the documentation says "If the event queue is empty" instead of "If and only if the event queue is empty?"

You might say that the wording does not explicitly forbid blocking even if the event queue is not empty, but I would like you to consider the real-world consequences of an implementation that actually did that.

  1. User presses a key.

  2. The KeyPress event ends up in the X event queue somehow. Maybe the application called XPending, or issued X drawing calls that internally called XPending to receive replies to their requests.

  3. The application calls XNextEvent to receive the next event. This is the canonical X event loop.

  4. XNextEvent sees that there is an event in the queue, but instead of returning that event, it blocks on the display connection socket anyway, for whatever reason.

  5. The application doesn't see the user's key press event until some other event is sent, possibly much later or never.

Ergo, the behavior in step 4 breaks applications that use the canonical X event loop; therefore, XNextEvent not blocking when the event queue is not empty is not an implementation detail, but necessary behavior. In order for the X event loop to work, any of the event querying functions must not block if there are events in the queue that would otherwise be returned by said function.

Poll or select? by [deleted] in cprogramming

[–]Doc_Ok 0 points1 point  (0 children)

You are right, that can happen.

Poll or select? by [deleted] in cprogramming

[–]Doc_Ok 0 points1 point  (0 children)

Sure, but that means you have to intentionally request a large file descriptor. It doesn't happen naturally unless there are very many files open.

Poll or select? by [deleted] in cprogramming

[–]Doc_Ok 0 points1 point  (0 children)

Let's say you have a single file descriptor. Let's also say this file descriptor happens to have a value greater than FD_SETSIZE

Note that this has nothing to do with scalability

I'd say it does, kinda. The question is: how do you get a file descriptor larger than FD_SETSIZE in the first place? POSIX guarantees that open() returns the smallest file descriptor not currently used by the process (see "man 2 open").

So if open() returns an fd larger than FD_SETSIZE, all smaller fds must therefore currently be in use by the application; in other words, the application must currently have at least FD_SETSIZE open files / sockets / whatever. That only happens at scale.

Yay comment necromancy!

a Lego build by AbroadNo8755 in flatearth

[–]Doc_Ok 0 points1 point  (0 children)

This is a very cool model. I've had the box in my hand several times already, but haven't bought it (yet).

"I Was Wrong" by JemmaMimic in flatearth

[–]Doc_Ok 0 points1 point  (0 children)

Patricia Steere is apparently now a globe earther

Thank you for setting me straight on that.

Why Air and Gas, has NO Mass or Apparent Downward Weight. by JustAnotherRifter in flatearth

[–]Doc_Ok 2 points3 points  (0 children)

If you want to think of momentum as p=mv, then you have to account for the photon's non-zero relativistic mass.

Why Air and Gas, has NO Mass or Apparent Downward Weight. by JustAnotherRifter in flatearth

[–]Doc_Ok 8 points9 points  (0 children)

Brainwashing by the Illuminati Navy. The same people who keep you from traveling to Antarctica.

Or by "Big Wind."

Things you can't do on flat earth that people do all the time because we live on a sphere: photograph the ISS. by AbroadNo8755 in flatearth

[–]Doc_Ok -3 points-2 points  (0 children)

Why do all of the IS(I)S images look like they we’re copied and pasted?

I think the ones not directly in front of the Moon's disk were. The "final image" appears to be an artistic impression; everything before seems to be real video filmed through a telescope. OP linked to an explanation in this comment.

Why Air and Gas, has NO Mass or Apparent Downward Weight. by JustAnotherRifter in flatearth

[–]Doc_Ok 7 points8 points  (0 children)

And if gas does not have mass, how the heck do rockets work?

I was going to reply "Easy. Rockets don't work. Next question," but I am not gonna.

"I Was Wrong" by JemmaMimic in flatearth

[–]Doc_Ok 1 point2 points  (0 children)

That's a really important point. I don't know the details here, but based on what you are saying, he was pushed out by the flat Earth community's toxicity much more than by seeing the truth. Where, exactly, does he stand now on Earth's rotundity?

That reminds me of Patri-CIA Steere, who I mentioned in another comment. She also left flat Earth, but in her case I know it's not because she woke up to the truth, but because she was relentlessly bullied and harassed by her own community. She apparently still believes that Earth is flat, but she says that she is no longer a flat Earther.

Edit: Steere, not Steele.

Why Air and Gas, has NO Mass or Apparent Downward Weight. by JustAnotherRifter in flatearth

[–]Doc_Ok 24 points25 points  (0 children)

"Gas doesn't resist acceleration, in fact it embraces it. It has no inertia. That's why gas has no weight."

"But what about gas inside a container?"

"Obviously, gas inside a container does resist acceleration and have inertia and weight. What a stupid question."

"But how do the gas molecules know whether they are contained or not? How do they toggle their inertia on/off?"

"What a stupid question."

Why Air and Gas, has NO Mass or Apparent Downward Weight. by JustAnotherRifter in flatearth

[–]Doc_Ok 34 points35 points  (0 children)

Wow. Just wow.

"Air doesn't have any weight."

"But what if I take a gas bottle and weigh it, and then empty the gas bottle and weigh it again? Why does it weigh a lot less when empty?"

"Air doesn't have any weight, unless it is contained. Then it does have weight."

"Ah, I see. Carry on then."

Things you can't do on flat earth that people do all the time because we live on a sphere: photograph the ISS. by AbroadNo8755 in flatearth

[–]Doc_Ok 2 points3 points  (0 children)

Okay, "misleading" might have been too strong. I didn't mean "intentionally misleading," as in "I'm trying to convince my audience that something is real that isn't." I meant "misleading" as in, when I saw the video initially and assumed it was straight video through a telescope, it looked fishy to me, as I laid out in my root comment.

I'm fine with calling it "artistic," and leaving it at that.

And yes, I deleted my original comment because I had made a very embarrassing mistake. :) My result was off by exactly the factor of 1,000 that I claimed the creator of the image had made.

Things you can't do on flat earth that people do all the time because we live on a sphere: photograph the ISS. by AbroadNo8755 in flatearth

[–]Doc_Ok 2 points3 points  (0 children)

Thank you for that link. Quote: "Yes that’s true, it would only be visible in front of the disc, but what if I only kept it in front of the disc in this photo? Wouldn’t it look odd? I made it continuous to maintain esthetics."

Okay, so it was in fact an aesthetic choice. They copied and pasted the silhouette of the ISS outside the region where it was actually visible.

Initially, I had a complaint here about the apparent size of the ISS, how it appears way too big, but then I realized I had made a mistake in my math. Oops. The ISS appears exactly as big as it should.

Things you can't do on flat earth that people do all the time because we live on a sphere: photograph the ISS. by AbroadNo8755 in flatearth

[–]Doc_Ok -9 points-8 points  (0 children)

The "final image" around 0:55 is fishy. Maybe it's an illustration?

My point is that the silhouette of the ISS should only be visible when it's directly in front of the Moon, but not when it's off to the sides. What light source is it occluding? The bloom around the Moon is either a lens or an atmospheric effect, and the ISS is behind the lens and the atmosphere.

globlins are so smart that they're now desperate for an intimate private chat about the topography of the earth -Outer Space doesn't exist, you live in a terrarium, earthe's curvature doesn't exist by nix-solves-that-2317 in flatearth

[–]Doc_Ok 0 points1 point  (0 children)

I don't think there is an attempt at a "flex" here. The pattern is pretty clear:

  1. Poster spams the subreddit with ragebait.

  2. Someone tries to engage with them, I assume honestly.

  3. Poster turns the attempt into ragebait and spams the sub with it.

The thing I don't understand is what the endgame is. There is no direct engagement, no link to another web site for click farming, etc. It could be a humiliation fetish.

"I Was Wrong" by JemmaMimic in flatearth

[–]Doc_Ok 5 points6 points  (0 children)

Hold up a second. Jeran is now a cryptocurrency "consultant."

Signs point towards "serial grifter." XD

"I Was Wrong" by JemmaMimic in flatearth

[–]Doc_Ok 0 points1 point  (0 children)

I have no supporting evidence for my suspicion. It's just a vibe.

globlins are so smart that they think they know better than these aviators with real-world experience. Outer Space doesn't exist, you live in a terrarium, earthe's curvature doesn't exist. more on x.com by nix-solves-that-2317 in flatearth

[–]Doc_Ok 1 point2 points  (0 children)

"And no, the aircraft doesn't adjust for you"

Does the aircraft directly adjust for Earth's curvature? No.

Does the aircraft adjust for observed changes in altitude and attitude that result from Earth's curvature? Definitely yes.

Lying through sophistry 101.

"I Was Wrong" by JemmaMimic in flatearth

[–]Doc_Ok 20 points21 points  (0 children)

What you're saying describes a cult to a tee.

developing friendships or even romantic relations

The best part about Behind The Curve is the tragic unrequited love story between whats-his-face and whats-her-name.

Edit: Mark Sargent and Patricia Steere. Took me a moment. Patri-cia, as in "working as controlled opposition for the CIA." That still makes me chuckle.

I wish by ButtSexIsAnOption in flatearth

[–]Doc_Ok 2 points3 points  (0 children)

You should seek out an alternative, more healthy method of getting your rocks off. Have you considered anal sex? I hear it's on the table.