Hacker Newsnew | past | comments | ask | show | jobs | submit | davidcuddeback's commentslogin

> Would you use the Builder pattern if the language had named variables in arguments?

Yes, absolutely. I see it all the time in the Ruby ecosystem and have used it myself in Ruby. Many times it gets called by a different name. I've seen it in Python and Elixir too.


> On the other hand, what's the chance of something like this happening with a much bigger asteroid.

Bigger asteroids are easier to see.


that's right.

another metric that affects the ... impact ... of such an event is also the speed of the asteroid. Unlike size, I suspect higher speeds would make it harder to spot (and once spotted there would be less time to take action)


Asteroids are just as visible at any speed.

Though warning times will be shorter the higher the relative speed is.


I think the OPs point was:

If we are only surveying a portion of the sky at a time and a faster asteroid spends less time traversing that portion, the likelihood of detection is lower.


Faster asteroids leave longer streaks.


I'm not sure if you are joking.

Assuming you are not. What kind of "streak" you are thinking about? Are you thinking about comets with their tails? Or motion blur?

Because if motion blur I would expect an asteroid on a collision course to have none. (at least in the short timeframe before the collision) Because "Constant bearing, decreasing range" is how a collision looks like from a first person perspective.


Your last paragraph is correct, but only very close to the collision. Things in orbit around the sun don't move in straight lines, even if their paths are going to intersect. The earlier you see it, the less it's moving straight at you.

(Of course, if it's going to hit you, the faster it's going, the more straight at you its path is at the same distance. But for the same amount of "not straight at you", faster leaves a bigger streak.)


Yeah given that were talking about objects that are colliding with the earth, the faster they will come closer to us the less time we'll have to spot them


"Nearest gap" doesn't sounds like a range query to me. It sounds more like a nearest neighbor query. It sounds like you have (start time, duration) tuples and want to search for nearest neighbor on start time with an at-least-X constraint on duration. (start time, duration) is more point-like than interval-like (as far as data structures go), so anything that can handle nearest neighbor on point-like data would be a candidate. If this is an accurate mapping for your problem, you might check out KD trees. You'd probably have to write a custom tree traversal algorithm to query NN on one dimension and >X on the other, but I think it could be done. Sounds kinda fun.


I have (start time, duration) tuples but would like to find the nearest entries (in either direction) given a specific time and minimum duration.

Thanks for the suggestion! I've tried some other spatial acceleration structures (e.g., R-tree and some others) and applying them in 1-d but they didn't outperform the ordered map unfortunately. It could be interesting to try out KD trees at some point though.


Sure thing! I'd reframe this as a nearest neighbor search over (start time, duration) tuples. KD trees are what I'm most familiar with for that problem, but there are others that would fit. Check out chapters 1 ("Multidimensional Point Data") and 3 ("Intervals and Small Rectangles") of Foundations of Multidimensional and Metric Data Structures: https://books.google.com/books?id=vO-NRRKHG84C&pg=PR9&source...

R-trees are more generic in that they can store intervals, shapes, volumes, etc, but (start time, duration) tuples are point-like, and that opens more possibilities. The ordered map is going to give you good memory locality. It might be that you'll only beat that when searching for larger durations (that require you to iterate over more of your ordered map). There will probably be an inflection point somewhere, depending on the distribution of your data and queries.

Hope that helps!


> Many range queries also have a minimum duration requirement, so it could be useful if a data structure could take advantage of this to quickly exclude intervals during the search.

Check out priority search trees. They search two dimensions, one of them being half-open (that would be your minimum duration requirement). Depends if the other half of your queries fits the closed dimension of a priority tree or if you can adapt it to fit your needs.


It's really going to depend on the queries that you want to optimize. I think the best help might be to point you to a book: https://www.amazon.com/Foundations-Multidimensional-Structur...

An RTree is the first structure that comes to mind, but the way you describe the problem, it sounds like the intervals never overlap, so I have my doubts. Sounds like you might be looking to optimize the query "what is the first interval of at least N days?" Maybe look at priority trees. They're good at queries that are bounded in one dimension and half-open in the other.


Thanks! I did try a 1-dimension R-tree but the performance tended to be much worse than an ordered map.

Priority trees could be really interesting. I did consider them early on but wasn't sure how well they'd apply here, so I'll take another look.


Elsewhere is the thread, it sounds like your range queries with inequality constraint might actually be a nearest neighbor query with inequality constraint. I'm not sure off the top of my head how feasible that would be with a priority search tree.


Case in point: the same equations predict white holes, which today are widely believed to not exist.


I’ve never seen one before — no one has — but I’m guessing it’s a white hole.


A white hole?


A door to past.


What is white hole ?


A person with a better astronomy background can jump in, but I'll start by quoting a couple trusted astronomy publications. In short, a white hole is an astronomical object with the property that light cannot enter it.

From the Universe Today (at https://www.universetoday.com/122715/what-are-white-holes/ ):

"Black holes are places in the Universe where matter and energy are compacted so densely together that their escape velocity is greater than the speed of light. […] Fully describing a black hole requires a lot of fancy math, but these are real objects in our Universe. […] So then what’s a white hole?

"White holes are created when astrophysicists mathematically explore the environment around black holes, but pretend there’s no mass within the event horizon. What happens when you have a black hole singularity with no mass? […]

"Now if white holes did exist, which they probably don’t, they would behave like reverse black holes – just like the math predicts. Instead of pulling material inward, a white hole would blast material out into space like some kind of white chocolate fountain. […] One of the other implications of white hole math, is that they only theoretically exist as long as there isn’t a single speck of matter within the event horizon. As soon as single atom of hydrogen drifted into the region, the whole thing would collapse."

And from Space.com (at https://www.space.com/white-holes.html ):

"White holes are theoretical cosmic regions that function in the opposite way to black holes. Just as nothing can escape a black hole, nothing can enter a white hole. […]

"To a spaceship crew watching from afar, a white hole looks exactly like a black hole. It has mass. It might spin. A ring of dust and gas could gather around the event horizon — the bubble boundary separating the object from the rest of the universe. But if they kept watching, the crew might witness an event impossible for a black hole — a belch.

"Physicists describe a white hole as a black hole's "time reversal," a video of a black hole played backwards, much as a bouncing ball is the time-reversal of a falling ball. While a black hole's event horizon is a sphere of no return, a white hole's event horizon is a boundary of no admission — space-time's most exclusive club. No spacecraft will ever reach the region's edge. Objects inside a white hole can leave and interact with the outside world, but since nothing can get in, the interior is cut off from the universe's past: No outside event will ever affect the inside."


A region of space time matter/light/information can exit but you can’t send anything to.

https://en.wikipedia.org/wiki/White_hole


I am taking kids out of school for a few days and driving 13 hours to a cabin that I rented on a lake on the centerline. It helps that my 40th birthday is within a couple days of the eclipse.


Jory Brigham?

Edit: Nevermind. Answered down thread. Lucky you. Beautiful area and Jory's work is phenomenal.


Thank you. I do feel lucky. I cold-emailed him two years ago asking if I can come sand or sweep and he invited me up. He and his family have been great and I’ve met amazing people there.

His workshops are my favorite weekends of the year, and I’m working during them, so I highly recommend it if you can swing it.


I've looked into some workshops, including his. It's not in the cards for me now, but something I'd like to do someday. I also enjoy coming back to the central coast (I went to college in SLO). Jory did some videos on his Hollister credenza for the TWW Guild. They captured (possibly unintentionally) the laid back central coast vibe with the open doors and the birds chirping in the background.


I'm not sure about the history of these words, but astronomy also uses the noun form: "occultation" [1], for which there's not an obvious equivalent for "occlude."

> Did occult mean what it does now when they started?

A word can have more than one meaning. The first definition on merriam-webster.com covers the definition used in astronomy:

occult (v.): to shut off from view or exposure: cover, eclipse [2]

The adjective form might be a source of derivation for the meaning you're alluding to:

occult (adj.): (1) not revealed: secret; (2) not easily apprehended or understood: abstruse, mysterious; (3) hidden from view: concealed [2]

And finally, the paranormal meaning that people are more familiar with today:

occult (n): matters regarded as involving the action or influence of supernatural or supernormal powers or some secret knowledge of them -> used with the [2]

Again, I don't know the history of these words. If I had to hazard a guess, I'd bet that the noun form, "the occult", is derived from the adjective form since "the occult" refers to supernatural phenomena, which is naturally hidden from view, concealed, not revealed, secret, not easily apprehended or understood, etc (because it's not real).

Edit: Another guess. If you think about the history of astronomy, it was originally intertwined with religion and astrology. Perhaps these words date back to a time when "the occult" and astronomy weren't entirely separate. Anyways, I agree. Language is strange.

[1]: https://en.wikipedia.org/wiki/Occultation

[2]: https://www.merriam-webster.com/dictionary/occult


Physical can be understood to mean "of or relating to matter and energy or the sciences dealing with them, especially physics." Light, temperature, and time are described by physics, so I would consider "physical" to be an accurate adjective for those units. You seem to be using a more limited definition of physical, closer to the word "spatial."

Also, btw, you might want to read the article you linked. The article is discussing a fringe idea that some scientists have. Scientists are free to explore new ideas, and they make for good click bait for science journalists. Until those ideas gain traction, they don't provide for compelling arguments, though.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: