News for hackers. Stuff that matters.

nayuki

Re:Gemini 4 Carbon on Wednesday October 28, 2026 @11:41PM (#50284307)
The comment you replied to was: "The only good products Google has ever built in-house are [...]"

I don't have enough information to judge how much of Chrome was original work and how much was pre-existing work. Though I guess by now, after nearly 20 years, Chrome's codebase looks absolutely nothing like KHTML.

Re:Gemini 4 Carbon on Wednesday October 28, 2026 @10:12PM (#50283746)
Google Chrome didn't start from scratch. Blink came from WebKit which came from KDE's KHTML. https://en.wikipedia.org/wiki/Blink_(browser_engine) , https://en.wikipedia.org/wiki/WebKit , https://en.wikipedia.org/wiki/KHTML
I see some irony here. For a period of time, Google chose not to include JPEG XL in Chrome because vulnerabilities in the library could compromise the software - a legitimate concern. Yet, Google is the author of the Brotli data compression format a decade before the JPEG XL drama, and was happy to use it in Chrome and encourage others to use the library, despite the fact that it also increases the attack surface.
Re:Show HN: Steal My Bitcoin on Saturday October 24, 2026 @05:09PM (#50225315)
The server is getting overloaded, so here's the text for reference:

    Steal my Bitcoin
    0.65 hours without a successful hack
    
    There is a bitcoin key hidden on this server worth about $502.
    
    It is accessible to the PHP user account through the print-flag binary.
    
    This PHP version was selected from before the PHP2SHELL CVEs were released.
    
    First person to get the wallet wins. If you don’t need the money, consider donating it to those who do: givewell.org.
    
    All traffic is logged. This is a known vulnerable machine, so we cannot guarantee privacy. Other attackers may access or monitor activity and data beyond our control. Do not submit anything you want to keep private.
    Challenge wallet
    Explorer ↗
    
    bc1qlnu5…t3cxqy
    
    0.00625104 BTC
    
    ≈ $502.35 USD
    stealmybitcoin.com · Terms of participation
Re:eMudhra to Exit Global SSL/TLS Certificate Business on Thursday October 22, 2026 @11:07AM (#50196447)
> About eMudhra / With over 17 years of expertise, eMudhra is a global provider of digital identity, trust, and security solutions, enabling secure digital transformation for banks and financial institutions (BFSI), enterprises, and governments across more than 35 countries worldwide. Its product suite spans CertiNext

I was hoping the statement at the bottom would be written in past tense: eMudhra was a global provider of digital identity ... had temporarily enabled secure digital transformation ... Its product suite spanned CertiNext...

Re:eMudhra to Exit Global SSL/TLS Certificate Business on Thursday October 22, 2026 @11:03AM (#50196394)
You can't do that because an RSA private key contains two numbers - the modulus and the exponent. Even better, an RSA private key usually has the modulus stored as its two factors rather than their product.

Also note that using small numbers like 65537 for RSA public exponents is common practice.

Re:eMudhra to Exit Global SSL/TLS Certificate Business on Thursday October 22, 2026 @10:58AM (#50196325)
> Bruh, you just literally went ——— BEGIN PUBLIC KEY ——— 4 ——— END PUBLIC KEY ———

No, their private key is 4. Moreover, you wouldn't see the literal number 4 because the PEM key file would have the cryptographic sections encoded in base64.

Re:Google cloud outage takes down banks on Tuesday October 20, 2026 @04:18PM (#50172069)
I'm impressed that Stack Overflow / Stack Exchange (presumably US-based) uses UTC for things like resetting daily vote limits.
Re:SimCity, but with Permits on Tuesday October 20, 2026 @04:11PM (#50171991)
> But yay, democracy? We can do anything as long as no one is subjectivly harmed.

Prospective residents and transit riders are harmed.

Rules and hearings overwhelmingly favor existing residents. If an existing resident opposes construction nearby due to noise, traffic, etc., the city will probably grant his wish. Because that piece of land is off limits for denser housing, now prospective residents face a smaller housing supply, higher prices, and longer commutes.

Re:OpenSCAD the Programmers Solid 3D CAD Modeller on Saturday October 10, 2026 @09:38PM (#50038981)
I use OpenSCAD as my primary design tool for 3D modeling. I get things done, but it isn't easy, and it's hard to recommend it to other people. OpenSCAD really requires the user to mathematics, trigonometry, mental visualization, and programming beforehand as prerequisites - unlike mainstream CAD programs which are more point-and-click friendly. Performing fillets and chamfers on corners is quite tedious, and describing a screw thread as a polyhedron is a nightmare, but I overcame these challenges.

On the plus side, I like these things about OpenSCAD:

* The software is open source, so price or pirating are not barriers, you can use it as much as you want on any computer you want for as long as you want, and it can never be taken away from you.

* The program is small and easy to download, not some multi-gigabyte sprawling software package.

* I think you learn to declare variables for parameters very early on, and it feels natural to make every design parametric from the start.

* The textual nature of 3D models means that I can use Git version control, diff between versions, and leverage similar developer-oriented tools that I use for general programming. I suspect that CAD programs that use binary file formats will have to come with their own diff tool and version control system.

* By reading source code, it's possible to follow the thought process of how a 3D model is constructed, and carefully make modifications in the middle of a chain of operations that later operations depend on. In point-and-click CAD, it's not clear to me if it's possible to change things in the middle of a chain.

* The Manifold renderer is so much faster than the old CGAL, resulting in reasonable human-interactive cycle times.

* I ended up writing my own library to cover a bunch of common shapes / use-cases. It does take some effort the first time, but then I keep reusing the results.

Re:How Machines Learned Precision on Wednesday October 07, 2026 @05:07PM (#49998812)
Good work! Your style of animated articles reminds me of the work of Bartosz Ciechanowski: https://ciechanow.ski/archives/ , https://news.ycombinator.com/from?site=ciechanow.ski
Re:How Machines Learned Precision on Wednesday October 07, 2026 @05:04PM (#49998778)
Some of your ideas have been covered before, e.g. https://www.youtube.com/watch?v=gNRnrn5DE58 , https://www.youtube.com/@machinethinking/videos . But I would love to see your take on the topic and see a more complete story.
Re:House with 15m underground tunnels for sale for 300k on Wednesday October 07, 2026 @05:02PM (#49998763)
This kind of activity has been repeated enough times to be an article: https://en.wikipedia.org/wiki/Hobby_tunneling
This project looks extremely ambitious. Are these applications coded by AI by any chance? I can't find any easy documentation about the development process.
Re:Demystifying Tufte's data-ink ratio – Tufte's Razor on Sunday October 04, 2026 @08:44PM (#49959524)
It makes me think of https://xkcd.com/688/
Re:When oil prices spike, where does the money go? on Wednesday September 30, 2026 @11:20AM (#49910140)
> my superannuation fund (401k, ROTH, IRA, hard to know what people call this in other economies)

In Canada, the comparable funds are: Canada Pension Plan (CPP, mandatory contribution for all employees), employer-managed pensions (not all companies have one; policies vary such as defined benefit vs. defined contribution), personal RRSP (you make the contribution and you select the investments).

I guess the comparable funds in the USA are: Social Security (mandatory contribution for all employees), employer-managed pensions (not all companies have one; policies vary such as DB vs. DC), personal IRA such as traditional/Roth.

> Uber is another key villain in Gouged. Per Owens, Uber’s “greatest innovation wasn’t ‘disrupting’ the taxi industry—it was socializing and normalizing the very idea of dynamic pricing. They made us comfortable with the notion that prices could change at any moment.”

In my opinion, Uber has several key innovations over traditional taxi services:

* An accurate machine-provided fare quote that you can review at your leisure before agreeing to take a trip. (Instead of, like, calling a human dispatcher to ask for a quote.)

* The fact that the passenger can't screw over the driver by making fake requests and not showing up, or running off at the end of a trip - because the online platform is in charge of the payment collection.

* The fact that the driver can't screw the passenger over by driving extra distance, because the price is set ahead of time.

> roughly 75 percent of the items in identical Instacart baskets purchased at the same time varied in price from one shopper to the next

If the price differential is large enough, it sets up an opportunity for arbitrage. Maybe if 10 people cooperate and compare notes on each of their Instacart account's product prices, and then make group purchases using the account with the lowest prices...

In general, it's harder (though not impossible) to price-discriminate on goods rather than services. If seniors get a grocery discount for example, then it might be worthwhile to hire a senior to purchase things on your behalf.

Re:How SLR cameras work: Nikon F3 (2023) [video] on Monday September 28, 2026 @12:50PM (#49880906)
This comes from mitxela, the same guy who made the fluid simulation on flipdots video that went viral a few days ago ( https://news.ycombinator.com/item?id=49854219 ).
Re:C's Flexible Integer Sizes Were Not a Design Mistake on Sunday September 27, 2026 @09:34PM (#49872544)
Because the language rules say so, and I'm not the one who made the rules. https://en.cppreference.com/c/language/conversion#Integer_pr...

> Integer promotion is the implicit conversion of a value of any integer type with rank less or equal to rank of int or of {a bit-field of type _Bool(until C23)/bool(since C23), int, signed int, unsigned int}, to the value of type int or unsigned int.

> If int can represent the entire range of values of the original type (or the range of values of the original bit-field), the value is converted to type int. Otherwise the value is converted to unsigned int.

The fact that the C/C++ integer conversion rules have these unintuitive footguns is why I made it a talking point.

Re:C's Flexible Integer Sizes Were Not a Design Mistake on Sunday September 27, 2026 @06:00PM (#49871287)
> 32-by-32 signed (you multiply -1 by -1 and get 1, with no overflow)

Wrong. You mentally casted each operand to int16_t before subsequently casting to int32_t. The first step is unjustified.

The correct calculation according to the C standard is: (int32_t)0xFFFF * (int32_t)0xFFFF, which definitely overflows.

Re:C's Flexible Integer Sizes Were Not a Design Mistake on Sunday September 27, 2026 @05:58PM (#49871276)
> multiplying two 32-bit values, recast as 64-bit signed integers, will not overflow

Factually wrong. Consider: (int64_t)0xFFFFFFFF * (int64_t)0xFFFFFFFF. It definitely overflows.

Re:C's Flexible Integer Sizes Were Not a Design Mistake on Sunday September 27, 2026 @05:46PM (#49871190)
Some pieces of code in the article look suspicious:

    #define LUAI_IS32INT ((UINT_MAX >> 30) >= 3)
If unsigned int is just 16 bits wide, then `65535 >> 30` shifts by more positions than the width of the type, which should be undefined behavior, right?

    #define NB CHAR_BIT
    #define MC ((1 << NB) - 1)
If we have a DSP machine (as mentioned in the article) where CHAR_BIT is 16 and int is 16 bits, then `1 << NB` is `1 << 16` which shifts as much as the width of the type, which I believe is undefined behavior as well.

Regardless of whether you think C's flexible integer sizes are good or bad, and whether it helped propagate the language, there's no denying that if you want to write portable code across machines, you have to put in more effort compared to a language with fixed-size integers. Whether this matters or not is a matter of situation and opinion.

Other than that, I made a simulator where you can set the bit width of each integer type, and then it shows you how `x operation y` gets promoted to some output integer type. https://www.nayuki.io/page/summary-of-c-cpp-integer-rules section "Conversion rules simulator"

Re:C's Flexible Integer Sizes Were Not a Design Mistake on Sunday September 27, 2026 @05:34PM (#49871087)
Thank you for being one of the few people who understands that in C/C++, `unsigned OP unsigned` can have each operand be promoted to a signed integer and then have the operation overflow and cause undefined behavior.

I chose to deal with this problem by doing a "pointless" operation to force a promotion to at least unsigned int. For example:

    uint16_t x = 0xFFFF;
    uint16_t y = 0xFFFF;
    uint16_t z = (uint16_t)((x + 0U) * (y + 0U));
This piece of code will work on any machine, such as: (uint16_t = unsigned short = 16 bits, uint32_t = unsigned int = 32 bits); (uint16_t = unsigned short = unsigned int = 16 bits, uint32_t = unsigned long = 32 bits).
Re:Transit rewards (Waymo pays you to take the train) on Wednesday September 23, 2026 @02:46AM (#49812518)
If buses and cars participate in the same road traffic (i.e. the bus doesn't have dedicated lanes), then a bus trip will never be faster than a comparable car trip. This is because you have to walk to/from the bus stop at both ends of the journey, wait for a bus to show up, ride the bus and have it stop for other passengers, transfer between routes, the bus has slower acceleration and turning than a car, etc.

Think about even the most strawman trip possible: A bus rider and a car driver start exactly at the location of a bus stop, the bus shows up exactly at the start time, both contestants ride/drive straight for a few kilometres (which happens to follow exactly one bus route, without changing buses; but the bus might stop a few times along the way for other passengers), and end exactly at a bus stop. The car will win every single time.

https://en.wikipedia.org/wiki/Downs%E2%80%93Thomson_paradox , https://www.youtube.com/watch?v=RQY6WGOoYis

Re:Solitaire Alone Together on Tuesday September 22, 2026 @03:28PM (#49806848)
Neat concept - a web remake of a classic Windows game. I found it very hard to win though, due to the "draw three" rule. I finally won on my 12th shuffle.

Aside from this web game implementation, in past decades I grew tired of solitaire and its constrained nature. I found myself enjoying spider solitaire a bit more, where you have to be more strategic about building stuff. I discovered spider because it's bundled with Windows. https://en.wikipedia.org/wiki/Spider_(solitaire)

Re:The Effect of CRTs on Pixel Art on Sunday September 20, 2026 @07:35PM (#49781266)
> Modern flatscreens all have fixed resolutions

True by design.

> and purely digital interfaces,

True but not relevant. Even if you connected an LCD monitor over an analog interface like VGA or composite video, it would have to re-digitize the signal. The fact that a screen uses a digital interface can be designed independently of whether a screen has fixed pixels (LCD, OLED) or not (monochrome CRT with continuous phosphor, without shadow mask or aperture grille).

> ensuring a fixed aspect (width-to-height) ratio

True by definition because the pixels are pieces of physical hardware in the screens.

> and completely square pixels.

This is a design choice. Nothing prevents someone from designing an LCD or OLED matrix with non-square pixels. But there's also no good reason to do so. (Side note: Due to RGB striping, single-color subpixels have an aspect ratio of 1:3, so those are non-square.)

Potentially useful trivia: Some image/video formats support declaring the pixel aspect ratio. Examples include PNG ( https://w3c.github.io/png/#11pHYs ) and Matroska.

8-bit: There is no IEEE 754 standard format.

16-bit: https://en.wikipedia.org/wiki/Half-precision_floating-point_...

Very interesting, you are right. The IEEE 754 standard defines positive/negative zero as not subnormal numbers.

Mechanically speaking, the two zeros use the subnormal number format, so in that sense they are subnormal (but definitionally they aren't). Also, I guess FPUs treat zero differently from other subnormal numbers, which is why zero doesn't have a performance penalty.

Relevant articles to read: https://stackoverflow.com/questions/73890260/why-is-zero-not... , https://en.wikipedia.org/wiki/Sterbenz_lemma , https://en.wikipedia.org/wiki/Subnormal_number

Re:Pixel is a unit of length and area on Friday September 18, 2026 @12:00PM (#49756336)
I think the notion of fractional pixels is rare indeed. But I can think of one example from astrophotography. After taking a photo, we use software to analyze the size of stars - for features like autofocus, auto-guiding, and detecting smeared images. Describing the full width at half maximum (FWHM) of stars with decimal pixels is normal practice. It's akin to fitting a Gaussian function to a measured peak, and letting the Gaussian have a fractional standard deviation that isn't constrained by the integer pixel grid.

I guess on that note, video compression motion estimation/compensation can also make use of fractional pixels.

Older »