Forgot your password?
typodupeerror

Comment Agents are good at finding bugs, not writing code (Score 1) 32

I've had no success getting Agents to help write code for SQLite. All the code I've asked Claude to write for me is slop that didn't work or worked poorly and never got committed. On the flip side, I do ask Claude to review the code that I write prior to committing, and it is good at that, often finding serious oversights that I had missed.

This observation, that agents are good at code review but bad at writing original code, seems to carry through into AI-generated bug reports coming into SQLite from third parties. The bug reports are generally good, but the suggested fixes not so much.

One report from about a month ago illustrates this. The median() aggregate function in SQLite is implemented by collecting the input values into an array of doubles, using quicksort to put them in order, and return the one in the middle. The bug report showed a carefully devised sequence of 1 million inputs that caused pathological O(N*N) behavior in the quicksort algorithm, which caused recursion to go too deep and blow out the CPU stack. The AI's suggested fix: Add a depth parameter to the quicksort algorithm and fail over to a slower sorting algorithm if the recursion goes too deep. The correct solution (originally recognized in the 1975 by Robert Sedgewick, but unknown to me before this issue arose) was to only call quicksort recursively on the smaller of the two partitions, and sort the larger partition using a loop (tail recursion). If recursion only occurs on a partition that is half the size of the original or smaller, recursion depth is limited to LogN. That turned out to be trivial to implement, and is faster and uses less code than the AI-suggested approach. Furthermore, after seeing Sedgewick's tail recursion idea, Dan Kennedy recognized that we don't actually need to sort both partitions at each step of the algorithm, but only the partition that contains the median. Dan's observation more than doubled performance. Hence by ignoring the AI's suggested fix, we more than doubled the performance of the median() function in SQLite.

Before you ask: The median() function did originally use the standard library qsort(), but I changed that into a hand-coded quicksort some time ago because the hand-written variant did not require a callback for each comparison, and was thus way faster.

Comment Some perspective (Score 1) 270

23% of that debt is owned by the Bank of England ("Gilt and Treasury Bill Holding"), which in turn is owned by... the British government.

Some more background information: https://www.taxresearch.org.uk...

In short, it is a choice to be beholden to the bond markets in this way. It is a political choice to outsource the fiscal margins of government spending to the financial sector, and paying them lavishly for that privilege. And no, I'm not saying this means you can spend endlessly on anything without very bad consequences. It's just that it's a very expensive way to provide the money supply and private savings, while giving enormous budgetary power to a sector that has proven time and again that it's unable to properly manage the economy's funding (if it's even interested in that at all, rather than just in enriching itself).

Comment "Smaller than a hair" - no (Score 1) 15

If you read the article carefully, they are talking about lenses THINNER than a hair. I see several of the posts here thinking the width/radius of the lenses is this small, a reasonable mistake given the way this was written. Having a radius that small would severely reduce their light gathering ability, requiring very bright light or very dim images or very long exposure times.

-

Comment Re:News flash, subtext (Score 2) 34

AI scrapers use these residential proxies. It's not (just) VPNs and Tor routing. Several bottom-feeding companies openly advertise such scraping services, for pretty much any country you may want. I administer a wiki that's been on the receiving end of such scraping, and the majority of these scraping requests are in fact coming from residential IP-addresses rather than data centers.

I don't know whether these are hacked accounts, people getting tricked or paid to run these scraping apps on their devices, but it's impossible to block them all. Even if you let fail2ban block entire /24s for every detected hit (even disregarding the collateral damage and the fact that these blocks don't solve the issue, the fail2ban and iptables overhead starts to outweigh the apache load at some point).

Anubis seems to be taking care of it for now, but it's obviously only a matter of time before they can deal with that one too. Although its delay does enable fail2ban rules to block the IP-addresses before they get to stress the mediawiki php scripts, attempting to diff 2 revisions of a random page from 10 years ago.

Comment Re:Not surprising (Score 5, Informative) 226

"Made in China" and then transported to and consumed everywhere else in the world isn't powered by fairy dust and unicorn smiles. It's easy to have low emissions when you externalise production. Let's see how it goes once (if) the process of bringing manufacturing back gets under steam.

Slashdot Top Deals

"Buy land. They've stopped making it." -- Mark Twain

Working...