News for hackers. Stuff that matters.

dizzant

Re:H.264 Is Magic on Thursday October 29, 2026 @06:55PM (#50297393)
Exactly correct. Quantizing is like rounding. This is the same notion as in quantum mechanics: the values aren’t any real number (a huge input space), but rather integer multiples of some constant (a small output space). Quantization is “rounding” to the nearest allowed output.

To build on the example used in the article, you could quantize an image by dropping the lower half of the bits of every pixel value. This discards half the information by mapping the larger input image space (e.g. 8 bits per pixel) to a smaller output image space (e.g. 4 bits per pixel), effectively scaling/rounding the original values.

The fact that higher frequencies can be quantized more intensely with relatively little image quality loss is a completely separate idea from quantization itself. In this context, high frequency masking as described in the article could be accurately described as a spatially dependent quantization to zero-bit output values. But the quantization part is the mapping, not the shape of the mask, and I think the article is misleading about the distinction.

In real codecs, there usually isn’t a hard boundary like a mask, but instead an empirical table of how many bits to keep based on the perceptual value of the information at each frequency.

Re:H.264 Is Magic on Thursday October 29, 2026 @05:36PM (#50296443)
I’m not saying that quantization doesn’t lose information. Instead, I’m saying that every step to lose information is not quantization. Functions on the preimage (clipping, masking) are not quantization.
Re:H.264 Is Magic on Thursday October 29, 2026 @02:53PM (#50294065)
I'm surprised that 10 years later, the article still teaches an incorrect conceptual understanding of "quantization".

The context heavily implies that quantization is "discarding information" generally (e.g. clipping, masking). The wikipedia article he links in the footnote disagrees, and so do I:

> quantization is the process of mapping input values from a large set (often a continuous set) to output values in a (countable) smaller set, often with a finite number of elements.

Quantization is a function over values, or the image itself. Clipping and masking, by contrast, are functions over the space/frequency dimensions, i.e. the pixel indices ("preimage"). A rule like "apply a circular mask" or "drop the first quadrant" does not depend on the values!

The most extreme example of quantization is a threshold filter. Regardless of location, output "1" if the pixel is brighter than X, or "0" otherwise. This depends only on the value, not on the location. He also misses the opportunity to point out that chroma subsampling is another application of quantization, this time to chroma values (drop the low-order bits).

Codecs like H.264 and JPEG use spatially-varying quantization rules to effectively discard more information at high frequencies, so his explanation of H.264 is spot on, but a non-expert encountering quantization for the first time would probably come away with the wrong idea. For an article explicitly targeted to non-experts that goes out of its way to introduce the term, it's a pretty important oversight.

Re:Git for US Legislation on Wednesday October 28, 2026 @05:05PM (#50280893)
> Only if those bold reforms weren't in the interests of the people they serve.

This is my point exactly: the creative process is impossible to do perfectly. If you want to find potential policies to enact, you need to examine very many policies that don’t work and aren’t in your constituents best interest. Those get left on the table and not advanced to actual congressional actions, sparing the legislator scrutiny for their creativity.

Some creative solution-seeking will happen in a bipartisan way through negotiation. I understand the desire to see the whole process, but removing the veil would change the behavior the participants. If every word were subject to partisan scrutiny from the wings, how could congresspeople possibly get anything productive done? See as evidence congressional committee hearings, in which the members spend significant time grandstanding for C-SPAN sound bites instead of productive questioning.

> When their behavior is conducted in secrecy behind closed doors the public doesn't have the ability to hold them accountable for it

This is obviously not true. Every bill has publicly documented sponsors and goes through a lengthy, public process with several rounds of procedural votes, committee approvals, amendment debates, etc. At some point there must be a minimum granularity of attribution. Track Changes from blank page to finished law would be useless anyway, because it would show some unpaid staffer actually typed most of the changes. Even Git history uses commits, and very mature projects like the Linux kernel revise their patches rather than keeping a detailed history of the patch creation. The champion who landed it and their reviewers are credited with the patch, as also in Congress.

> Often most of that work is done entirely for them by corporations and lobbying groups

The drafting and ideation? Sure! I wouldn’t want it any other way. It’s much better that we have an entire industry of people studying the law, finding solutions, and advocating their preferred options, rather than a group of Philosopher Kings making the law in isolation. You’re also dramatically downplaying the effort of coalition building, balancing constituent pressure, and passing procedural hurdles that is required to take a bill all the way from draft to law.

I think we may agree that provenance of bill text originating from outside of Congress could potentially be more transparent. But then again, the relevant interest groups are usually very well known by the time a bill reaches the floor anyway because that is their whole purpose, and they want to take credit for their victories. And “Monsanto drafted these provisions” is pretty far from the vision of absolute transparency and zero congressional privacy that you seem to be suggesting.

Do you have other specific ideas to increase transparency? If bill sponsor attribution, public debate and amendment, and recorded voting record are insufficient to understand a legislator’s actions, what would you suggest instead?

Re:Git for US Legislation on Wednesday October 28, 2026 @12:51AM (#50269462)
Transparency has a cost. There are several good reasons, but my favorite is intellectual freedom. Policy makers would be much less likely to explore bold reforms or risky bipartisan compromises if their draft quality notes and correspondences were publicly tied to their political reputation. It takes significant work to produce successful legislation, and much of that work can be productively and safely done without direct public oversight. This is the same reason an individual might value a private journal.

If you have a problem with your representative’s behavior, call their office and ask about it. They will certainly have a reason. Tell them if you disagree, and vote when you can.

Re:NP-Overrated on Thursday August 13, 2026 @10:18PM (#49294086)
Would you disagree that, given the choice, a solution to every problem is strictly better than a solution so only some problems?
A real treat for all the pilgrims on the Camino this year
Re:Claude Opus 4.8 on Thursday May 28, 2026 @09:16PM (#48317776)
Pronounced like “groom” makes for a nice analogy with slimming down the model size too.
Re:Attention Media ≠ Social Networks on Sunday February 22, 2026 @12:35PM (#47112875)
This. My wife and I can hardly buy each other surprise gifts because the targeted advertising gives us away every time.
Re:Trump's global tariffs struck down by US Supreme Court on Friday February 20, 2026 @01:24PM (#47091735)
In his dissent [1], Justice Kavanaugh states:

> Given that the phrase “adjust the imports”—again, in a statutory provision that did not use specific words such as “tariff ” or “duty”—was unanimously held by this Court in 1976 to include tariffs, and given that President Nixon had similarly relied on his statutory authority to “regulate . . . importation” to impose 10 percent tariffs on virtually all imports from all countries, could a rational citizen or Member of Congress in 1977 have understood “regulate . . . importation” in IEEPA not to encompass tariffs? I think not. Any citizens or Members of Congress in 1977 who somehow thought that the “regulate . . . importation” language in IEEPA excluded tariffs would have had their heads in the sand.

The roll-call vote for HB7738 (IEEPA) was not recorded [2], so we seemly can't confirm today how any sitting members voted at the time. But there are two members of Congress remaining today who were present for the original vote: Chuck Grassley (R-Iowa) and Ed Markey (D-Mass). They clearly both agree with the Court, while having different opinions on the tariffs themselves.

Statement by Grassley [3]:

> I’m one of the only sitting members of Congress who was in office during IEEPA’s passage. Since then, I’ve made clear Congress needs to reassert its constitutional role over commerce, which is why I introduced prospective legislation that would give Congress a say when tariffs are levied in the future. ... I appreciate the work [President Trump] and his administration are doing to restore fair, reciprocal trade agreements. I urge the Trump administration to keep negotiating, while also working with Congress to secure longer-term enforcement measures.

Statement by Markey after previous decision in August [4]:

> Today’s ruling in the U.S. Court of Appeals for the Federal Circuit makes it clear that President Trump’s chaotic tariff policy is illegal. ... Today’s ruling is an important step in ending the economic whiplash caused by Trump’s abusive tariff authority.

N=2 is scant evidence, but it seems like both sides of the aisle "had their head in the sand", or Justice Kavanaugh's historical interpretation is a bit off.

[1] p.127: https://www.supremecourt.gov/opinions/25pdf/24-1287_4gcj.pdf

[2] g. 22478: https://www.congress.gov/95/crecb/1977/07/12/GPO-CRECB-1977-...

[3] https://www.ketv.com/article/lawmakers-from-nebraska-iowa-re...

[4] https://www.sbc.senate.gov/public/index.cfm/2025/8/ranking-m...

Can an industry insider confirm this tracking? Interesting take, thank you. I hadn’t considered the privacy implications of tipping.
Re:Using an Engineering Notebook on Wednesday February 11, 2026 @11:15PM (#46984847)
In my research I take notes exactly as described here. I use plain-text files, one per week, with dated sections using markdown-ish notation where convenient. Display is never a goal; approximately 80-char column plaintext is the target format.

I agree with other commenters here that typing gives me more flexibility, in particular when writing arguments. I’ll format each point as a bullet and rearrange the list until I’m satisfied with the flow.

The notebook is essential for recovering tidbits learned along the way, e.g. what tricky steps did I need to get that one dependency to build. Weekly notepads are coarse enough to search by memory and contain enough context to get oriented quickly when going back several months.

Re:It's All a Blur on Wednesday February 11, 2026 @08:23AM (#46974644)
I recall a paper from many years ago (early 2010s) describing methods to estimate the camera motion and remove motion blur from blurry image contents only. I think they used a quality metric on the resulting “unblurred” image as a loss function for learning the effective motion estimate. This was before deep learning took off; certainly today’s image models could do much better at assessing the quality of the unblurred image than a hand-crafted metric.
Re:A closer look at a BGP anomaly in Venezuela on Thursday January 08, 2026 @09:04AM (#46541080)
This is... hard to follow. You seem to be implying that Cloudflare is covering for USG's failed military op-sec surrounding a malicious BGP leak, and judging that this is such a bad action (on the part of Cloudflare) to undermine your trust, not only in Cloudflare, but in all companies and the US government entirely. I don't think the situation is so dire.

Cloudflare's post boils down to Hanlon's razor: a plausible benign interpretation of the facts is available, so we should give some scrutiny to accusations of malice.

Are there specific relevant facts being omitted in the article, or other factors that diminish Cloudflare's credibility? They're clearly a qualified expert in this space.

Let's assume for the sake of argument that the BGP leaks (all of them from the month of December, in fact) were the result of secret US military intelligence operations. The fact that militaries generally use cyber vulnerabilities to achieve their objectives is not news, and the US military is no exception. Keeping specific exploits secret preserves a valuable advantage over competitor states.

One could argue that Cloudflare's post helps to preserve USG's secrecy. We can't know publicly whether USG solicited the article. But even if we assume so (again assuming malice): Is Cloudflare wrong to oblige? I don't think so, but reasonable people could disagree.

Merely pointing out Hanlon's razor doesn't fundamentally change the facts of the situation. In Cloudflare's expert opinion, the facts don't necessarily implicate USG in the BGP leaks without an assumption of malice. Assuming Cloudflare is malicious without justification is just deeper belief in the conspiracy that they're arguing against.

If Cloudflare is distorting the facts, we should believe (rightly) that they're malicious. But I don't see any evidence of it.

EDIT: Clarity tweaks.

The scientific report is much more detailed: https://cdn.realfood.gov/Scientific%20Report.pdf

I agree with siblings that nothing jumps out (to my non-expert eye) as "very extreme".

EDIT: Removed long-winded snark after a more careful reading of the linked document.

Re:Learning the oldest programming language (2024) on Wednesday December 17, 2025 @08:41AM (#46301832)
> a quick introduction to a few modern Fortran features: declaring variables, printing and reading to and from the terminal, if and select case, and stop

Pretty much sums up this one. Can't say that I agree if/select/stop are "modern" features.

I’ve never heard of this. Are you saying I could enter “MyLocal Bank” as the payer name instead of my own when transacting online with a credit card? This seems like the kind of fact that should be essential privacy knowledge if true!
Re:Scaling HNSWs on Tuesday November 11, 2025 @03:41PM (#45892535)
To be clear, I'm not disagreeing with antirez at all. I feel his argument in my bones. I am a smart programmer. I want simple, powerful systems that leave the kid gloves in the drawer.

The unfortunate reality is that a large cadre of people cannot handle such tools, and those people still have extremely valuable contributions to make.

I say this as a full-time research engineer at a top-10 university. We are not short on talent, new problems, or funding. There is ample opportunity to make our systems as simple/"pure" as possible, and I make that case vigorously. The fact remains that intentionally limiting scope for the sake of the many is often better than cultivating an elite few.

Re:The lazy Git UI you didn't know you need on Tuesday November 11, 2025 @03:29PM (#45892421)
I am often responsible for landing branches created by colleagues who are less disciplined about their diff cleanliness than me. Very often, attempting to regroup a spurious change from an early commit to a separate "cleanup" commit results in a long conflict hell.
Re:Scaling HNSWs on Tuesday November 11, 2025 @03:25PM (#45892371)
> many programmers are smart, and if instead of creating a magic system they have no access to, you show them the data structure, the tradeoffs, they can build more things, and model their use cases in specific ways. And your system will be simpler, too.

Basically my entire full-time job is spent prosecuting this argument. It is indeed true that many programmers are smart, but it is equally true that many programmers _are not_ smart, and those programmers have to contribute too. More hands is usually better than simpler systems for reasons that have nothing to do with technical proficiency.

Re:The lazy Git UI you didn't know you need on Monday November 10, 2025 @03:00PM (#45880215)
Thank you for the many tool links! You seems to know this space well. I have come to pick your brain for more.

I have been searching for a while for good tools to split/regroup diffs in a patch series. hunk.nvim looks interesting. Do you know of similar/competing tools?

I frequently hit a problem where removing a spurious hunk from an old commit causes cascading conflicts in all subsequent commits. Are there tools to propagate hunk removal into the future without the manual conflict-resolution pain?

Thanks again!

Re:Ireland Is Making Basic Income for Artists Program Permanent on Wednesday October 15, 2025 @02:53PM (#45596890)
An underrated reason to remove eligibility testing is to make programs accessible for people in poverty. Navigating a means-tested welfare program is byzantine in the worst way-- accessing and submitting countless forms with confusing, often ambiguous or incomplete instructions; standing in long lines at specific times/locations far from the city center to get help or make progress; complete lack of process transparency; and dependence on faceless bureaucrats to decide your fate.

My family once had to navigate Medicaid. I was well-resourced, understood the expected outcome thoroughly, was motivated to get it done, and committed the time to follow the required process. When our initial application was mishandled due to inaccurate guidance, it took over 2 years of persistent failed communications with the various county, state, and federal agencies, back-office middlemen, doctors, and legislators to get any response beyond "apply again and hope for the best", which we did several times to no avail. In the mean time, having a Medicaid application open changes the availability of medical care, as some doctors will not or cannot by law accept additional Medicaid patients. Eventually by some mild social engineering I procured direct access to a specific empowered bureaucrat who had knowledge of a separate set of applicable rules/processes and resolved our case immediately.

Most people in poverty do not have the time, attention, or stamina to persist through means testing on top of struggling against whatever landed them in poverty in the first place. Every time I visited the county office, I would hear someone complaining about how they had applied 8 times without success for a program everyone in the room agreed they should qualify for. Means-testing is designed, by popular demand, to make accessing benefits difficult for the sake of spending less. UBI, for all its faults, at least addresses that problem.

Re:Tcl-Lang Showcase on Tuesday October 07, 2025 @10:54AM (#45503846)
I used Tcl at my very first internship for test automation. Coming from a self-taught Javascript/Java/C#/C++ background, Tcl really stretched my concept of what a programming language is, especially how it plays with stack frames and munges string values.

Coincidentally Tcl also inspired my first deep dive into Vim. The test automation framework at that company required meaty Tcl expressions packed into CSV cells. Tcl was mind-boggling enough when properly formatted, so hand-editing squashed 1800 character long expressions on a single line was way too much. I'm fairly certain the assignment was part hazing and the framework part "job security".

Jokes on them, I spent 2 weeks on a side quest to make a Vim plugin that could add line breaks and indent a Tcl expression into a split temporary buffer for editing and squash it back to the right cell when I was done. Halfway through the summer I had completed the entire backlog. The manager got a reprimand for being a jerk and I spent the rest of the summer making the framework less painful.

You’re right, shallowly — the quality of their implementation bears on these results.

One could read this paper as Salesforce publicly weighing their own reputation for wielding existing tools with competence against the challenges they met getting those tools to work. Seemingly they would not want to sully that reputation by publishing a half-baked experiment, easily refuted by a competitor to their shame? It’s not conclusive, but it is relevant evidence about the state of LLMs today.

Re:The Rise of the Japanese Toilet on Saturday May 31, 2025 @10:14PM (#44148203)
I interpreted this to mean he holds clean water (e.g. from a bottle) in his mouth when entering the toilet, for the purpose of wetting toilet paper. A clever solution, IMO.
Certainly! The limit is your creativity. My first idea: generate very large scale 2D noise. Choose a threshold to divide it into regions. For each region, choose a direction of motion. Design a “mountain envelope” function that considers distance from the nearest border to create mountains/subversion zones based on the direction of each plate and the shape of the border.
You're correct that the Supreme Court ultimately has final appellate jurisdiction on matters of immunity, but that's a long way from enabling dictatorship.

To get there, we would need to assume that the Supreme Court, including only 3 Trump-appointed Justices, is both unwaveringly partisan and unwaveringly supportive of dictatorship.

Older »