6,720 karma · joined May 31, 2011 (15y ago) · 2,160 submissions
Home page: https://www.nayuki.io/
comment 2d ago · link · parent
comment 3d ago · link · parent
And at least with GC, you are guaranteed to surrender the possibility of double-free and use-after-free.
comment 3d ago · link · parent
Otherwise, if tax forms are translations of underlying laws, then how do you know the forms are themselves correct? It's the exact same problem that you're positing about whether code matches law.
Since the whole point of tax forms is to perform a calculation - and preferably perform it correctly and deterministically - it's much better to leave that task to a computer than to a human.
To give a concrete example of how tax forms could benefit from code, take the 2025 Canadian federal personal income tax form (T1), and I'll comment on some features. https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5006...
> Employment income (box 14 of all T4 slips)
This references another data structure (T4 slip) and asks you to sum all of them (implied by the word "all"). But it's ambiguous because in some programming contexts, "all" means returning a list of numbers or items.
> Elected split-pension amount (complete Form T1032)
This basically asks you to jump into a subroutine, do some calculations, and return the result here.
> Amount of dividends (eligible and other than eligible)
This is a filter operation followed by a sum.
> if negative, enter "0"
In math notation, this is x = max(y, 0).
> Use the amount from line 26000 to complete the appropriate column below.
This repeats something a few lines down and is only useful for clarifying for humans.
> Line 70 minus line 71 (cannot be negative)
This is a sanity check like assert(x >= 0).
> Enter whichever is less: $1,471 or line 1 plus line 2.
There are actually two line numbering systems happening simultaneously, one on the left of the money box and one on the right.
> Amount from line 42000
Some instructions merely copy numbers from other sections in order to get the data more local to the current problem being handled. Computers don't care about locality in this sense.
comment 3d ago · link · parent
comment 3d ago · link · parent
comment 3d ago · link · parent
This claim sounds like a tidy solution, but my gut feeling is that it doesn't really solve the problem. I struggle to articulate exactly why I think it's wrong, but I'll list some ideas:
* The camera presumably holds an asymmetric private key. The camera is in the user's hands, and chips could be removed and examined to extract the key with immense difficulty. Extremely few people in this world have the knowledge and equipment to do this, but it only takes one person to break the system for everyone.
* The camera maker might leak the key through negligence. Look at other examples where companies leaked TLS/SSL private keys or other cryptographic secrets.
* This scheme seems to give a lot of power to a small number of companies to define image authenticity in a proprietary way. This gatekeeping doesn't seem like a good direction for society.
* If someone is determined to break the system, eventually someone does. Look at the history of DRM and how countless schemes have been broken. Look at how Intel SGX was broken (it claims to allow a CPU to execute secret computations on behalf of someone else without the physical hardware owner being able to inspect those computations).
* Some image authentication schemes were cracked, such as ElcomSoft breaking an older version of Canon's scheme in the year 2010.
* What if a genuine camera takes a real photo of a real film slide or electronic monitor displaying utterly ridiculous imagery? (Analogous to the analog hole for DRM.)
* Does the private key have an expiration date? At any given point in time, is there an assumption that all photos older than a certain time have unreliable signatures? (Think of how the TLS certificate authority infrastructure comes with expiration dates.)
I don't have the answers to this problem. One thing I want to suggest, though, is that images coming straight off a camera have a lot of detail, and I think that is hard for AI to fake. Faking an image at Instagram resolution with relatively high JPEG compression seems plausible. Faking 6000×4000 pixels (24 MP) without leaving telltale seams and artifacts is a lot harder. I say this as someone who does digital photography and spends a lot of time pixel-peeping.
> The types of forensic analyses that I routinely perform do not currently operate at internet scale and speed.
Fair point. But I don't think you can tech-shortcut your way out of this problem.
> These provenance signals are often criticized as being only a partial solution or vulnerable to attack. This is true if we think of them as mechanisms for catching bad actors. But that’s not what they’re supposed to do. Their purpose is to let good actors prove that their audiovisual recording is what it claims to be.
You're being too charitable. It only takes one bad actor, one successful cracker to destroy the foundations of authenticity. One credibly signed fake image is enough to cast doubt on all the signed real images out there.
comment 2w ago · link · parent
I would argue that the missile performs the ultimate in physical garbage creation at the end of its flight.
comment 2w ago · link · parent
comment 2w ago · link · parent
comment 3w ago · link · parent
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.
comment 3w ago · link · parent
comment 1mo ago · link · parent
comment 1mo ago · link · parent
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 participationcomment 1mo ago · link · parent
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...
comment 1mo ago · link · parent
Also note that using small numbers like 65537 for RSA public exponents is common practice.
comment 1mo ago · link · parent
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.
comment 1mo ago · link · parent
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.
comment 1mo ago · link · parent
comment 1mo ago · link · parent
comment 1mo ago · link · parent
comment 1mo ago · link · parent
comment 1mo ago · link · parent
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.
comment 1mo ago · link · parent
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.
comment 1mo ago · link · parent
30.
How SLR cameras work: Nikon F3 (2023) [video](youtube.com ↗)
4 points · by nayuki · 1mo ago · 1 comment