News for hackers. Stuff that matters.

symmetricsaurus

Re:Carrier Landing in Top Gun for the NES on Monday December 15, 2025 @10:09AM (#46275468)
Don't think there was ever a Top Gun for Virtual Boy.
Re:A string formatting library in 65 lines of C++ on Tuesday September 16, 2025 @12:56AM (#45258156)
Pretty neat and a very nice walkthrough of the code.

For localization you might want numbered holes which makes it way more complicated.

You can detect if the backing buffer is too short, but can you detect other errors? Like having different numbers of holes and arguments? I couldn’t find any discussion about this.

Re:Caesar's Last Breath on Friday May 23, 2025 @11:17AM (#44073645)
Well actually, air molecules (N2, O2) are indistinguishable. This means that they are fundamentally interchangeable with each other and it’s not well defined what ”same” molecules mean. You can’t label the individual molecules.

It’s of course possible to track a single molecule if you really try hard. But this hasn’t been done since Caesar's time and the molecules have mixed. Even if we knew the exact state of the universe right now and could play back time perfectly it would be impossible to say that some particular molecules were part of his last breath.

Re:Vvvvvv Source Code on Wednesday May 07, 2025 @03:35AM (#43913108)
Second this recommendation!

It’s a super fun game to learn. It looks impossible to start out but then your brain adapts. It’s like seeing through the matrix.

The result is only significant to 3.39 sigma. Pretty good chance this is just a random fluctuation that will go away if you look at more galaxies.
Also first click is never a mine (if there's one where you click it's moved to the top left corner).
Re:Starcraft (A History in Two Acts) on Sunday July 07, 2024 @09:22AM (#40897521)
Apparently smart triangulation of the game world, A*, plus boids pretty much.

https://www.gdcvault.com/play/1014514/AI-Navigation-It-s-Not

Should have a (2022) perhaps this post?
Re:Ron Patrick's Street-Legal Jet Powered Volkswagen Beetle on Friday October 06, 2023 @10:12AM (#37791040)
Volvo did this back in 1992 but only as a concept vehicle https://en.m.wikipedia.org/wiki/Volvo_ECC
Re:A CD Spectrometer on Wednesday September 13, 2023 @08:19AM (#37495739)
In my high school physics class we measured the pitch between the tracks of a CD using the same principle. You just need a light source with a known wavelength, like a laser. It was a pretty cool experiment!
Re:Circles Rolling on Circles (2014) on Monday May 29, 2023 @08:31AM (#36113319)
Yes I’m thinking in terms of different frames of reference.

Imagine that you’re a tiny ant that lives on the large circle. When you push the small circle around the large circle you will see it make four rotations before you get back to the starting point. This is the local frame of reference.

Now imagine you’re a giant living in the space with the circles. You see the small circle do five full rotations. Four are the same that the ant sees but you also see the ant itself do one rotation simultaneously as it walks along the large circle making five in total.

It would be more accurate to say that you have 4 local rotations and that the local frame rotates one full turn in the global frame.

Does this make sense to someone with a high-school level of geometry knowledge? Not as I wrote it I initially (but there was no such goal). The analogy with the giant and the ant together with some nice illustrations maybe?

Re:Clever Code Considered Harmful on Monday May 29, 2023 @06:54AM (#36112700)
Making code simple is not easy.

In your analogy I think the listener should be the junior programmer. Music by Beethoven can be appreciated by many more than just the people who can compose on that level.

In the same way you can write code so that also junior developers can appreciate it. The challenge lies in clearly expressing solutions to complex problems.

Re:Circles Rolling on Circles (2014) on Monday May 29, 2023 @06:46AM (#36112647)
Interesting case!

You can see it is R/r local revolutions of the small circle. Then you need to add one global revolution from going around the large circle. So R/r + 1.

This is of course what the article is saying pretty much.

Are there other situations that require a similar reasoning?

Re:The Fourier Transform, explained in one sentence on Sunday January 15, 2023 @08:37AM (#34389280)
Instead of energy, it should say amplitude(and phase since it’s an inherently complex thing).
Re:The Wavefunction Collapse Algorithm explained clearly on Tuesday December 20, 2022 @11:11AM (#34067901)
You can use it solve sudokus as well [0]. I find the parallel quite enlightening.

[0] https://norvig.com/sudoku.html

Re:The Wavefunction Collapse Algorithm explained clearly on Tuesday December 20, 2022 @10:34AM (#34067299)
Oskar Stålberg has famously used WFC in Bad North and Townscaper.

Here's a nice presentation from him explaining it: https://www.youtube.com/watch?v=0bcZb-SsnrA

Re:Balloon framing is worse-is-better (2021) on Wednesday December 14, 2022 @07:24AM (#33982552)
Europe is not uniform in this regard. For example in Sweden almost all houses are built out of wood.
Re:Recursive Game of Life on Wednesday December 14, 2022 @06:51AM (#33982321)
The OTCA metapixel has 2048x2048 cells and a period of 35328. That's a total of 18.5 GB. And that's not counting the different states depending on neighbors and on-off-transitioning state.

Even with compression that's a lot of data.

Re:Recursive Game of Life on Wednesday December 14, 2022 @12:49AM (#33980412)
Very smooth. Wonder if there are any optimizations like Hashlife going on? There’s a lot of spatial redundancy to exploit.

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

Re:GCC undefined behaviors are getting wild on Monday November 28, 2022 @04:18AM (#33771371)
Yes, and in particular the compiler can assume that you stay within the defined behavior. That's what's enabling the optimization in removing the i < 0 check.
Re:GCC undefined behaviors are getting wild on Monday November 28, 2022 @02:41AM (#33770781)
There’s no reason to expect the result of integer overflow to be negative, or any particular value at all. It is undefined.

So after checking that x > o there is no way for i (a product and ratio of positive numbers) to become negative.

The only reason this is surprising is that there is an expectation of wrapping on overflow. But this is simply not the behavior of the C virtual machine.

(Maybe today it makes sense to have even C wrap in a two’s-complement way? C is used in many places though, maybe there are still platforms in use that aren’t two’s-complement?)

Re:Undefined Isn’t Unpredictable on Tuesday November 08, 2022 @02:06AM (#33516634)
You’re gonna get the same result each time you compile. But if you change _anything_ the results can be completely different. So, I can agree that it’s not a very useful predictability.
Re:Undefined Isn’t Unpredictable on Monday November 07, 2022 @11:24AM (#33507904)
The situation in C++ is similar. With a particular compiler and with a specific set of compilation flags you can sometimes get predictable behavior even if it's undefined (and sometimes not). But, there are no guarantees and if you change compiler, flags or perhaps even some other part of the code the behavior can change.

Perhaps with out of order CPUs relying on something that is undefined could change based on adjacent instructions also?

Conway's Game of Life does consider diagonals. Since they start and finish by talking about GoL I think they've made a mistake.
I don't understand the update rules as described in the readme.

In an 3x3 neighborhood there are 2^9, not 2^5 states. So we should get 2^512 possible update rules, not 2^32.

I think something similar is described in https://conwaylife.com/wiki/Rule_integer.

I'm not sure that all of those rules are valid. We must have translational invariance. One way to do that is to only update the state of the central cell in each considered neighborhood. In that case 2^9 rules are enough. Are there other ways to define consistent rules for a CA?

Re:Absurd Trolley Problems on Wednesday July 06, 2022 @04:47AM (#31998365)
Re:When FFI function calls beat native C on Monday April 04, 2022 @12:46PM (#30908807)
Previously: https://news.ycombinator.com/item?id=17171252

(Linked from the article)

Re:Cornell McRay T'Racing on Thursday December 23, 2021 @06:55PM (#29668066)
Most probably is rally driver Colin McRae[0], after whom a popular series of rally games are named[1].

[0] https://en.wikipedia.org/wiki/Colin_McRae

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

(edit: formatting)

Re:Does the Bronze Garbage Collector Make Rust Easier to Use? on Thursday December 23, 2021 @03:55AM (#29659993)
> A key tradeoff is that Bronze does not guarantee thread safety

Not having data races is one of the key benefits of using Rust, “fearless concurrency” and all that. So by throwing away a key guarantee of Rust (no aliasing mutable references), it can become easier for learners to program in. It becomes a bit of an apples and oranges situation at that point.

Older »