HNHacker News
TopNewBestAskShowJobs

danbruc

9,770 karma · joined October 13, 2012

submissionscomments
danbruc··on Anthropic researcher believes more than 10% chance AI 'could kill all humans'
Can somebody tell me a story how this will unfold? And - as long as the AI is confined to data centers - how it will prevent humans from unplugging the power?
danbruc··on ChatGPT outage – Resolved
Why does this use 2+1 and 4+1 instead of 3 and 5?
danbruc··on 9000 RPM is faster than your screen refreshes
But even with 244 Hz the engine running at 9000 rpm or 150 Hz will not even give you two frames per revolution, about 221° of rotation per frame to be precise. If you want a somewhat smooth animation, say 10° per frame, you want to look for a 5400 Hz monitor.
danbruc··on P99 0 ms* autocomplete for 240M domain names
For triggering actions (which includes normal typing), you only ever use keydown.

I think you have this wrong, actions generally occur on button release, until that you can move the mouse cursor to a different target, tab to another control, use [ESC] to cancel, and so on. Typing, moving a slider with the cursor keys, and similar things that make use of key repetition while holding down the key are the exception to this.

danbruc··on Devtools must be open source
Just run a full-text search on the old value.

How often does 10 appear in the code base? And is the value you are looking for even 10 or does only the UI show 10 points but in code it is defined as 200 twip?

danbruc··on Safe Lock-free Primitives with iceoryx2's ByteAtomic
I suspect adrian_b is talking about a scenario where a rouge thread essentially writes random garbage to random addresses in the address space.
danbruc··on Safe Lock-free Primitives with iceoryx2's ByteAtomic
About what scenario are you actually talking? Are all threads using the read() and write() functions of the shared data structure? In that case it is absolutely possible for readers and writers to make progress even if a rogue writer is calling write() in a tight loop.

Or are you talking about a scenario where a rogue writer essentially randomly modifies the shared data structure instead of using the designated write() function? Well, in that case all bets are obviously off.

danbruc··on Safe Lock-free Primitives with iceoryx2's ByteAtomic
[...] because if a writer enters an infinite loop while writing the shared data, that will stop progress in any other algorithm [...]

Even if you have

  while (true) { sharedData.writeWaitFree(randomData) }
all other threads will be able to continue. Whether the result will be of any value will depend on the use case.

If, on the other hand, you mean that some threads will enter an infinite loop inside of a read or write operation, then you have a bug in your wait-free algorithm and all bets are off. But we would generally assume that the implementation is good and the erroneous behavior is external.

danbruc··on Safe Lock-free Primitives with iceoryx2's ByteAtomic
No, such algorithms exist and they use various mechanisms to achieve this. For larger data structures a common trick is to make a copy, update the copy, and then replace the original or parts of it with the copy. This provide readers with a stable view of the data structure that does not depend on small atomic reads. Another mechanism is that the different threads help each other to complete their interrupted work instead of making it invalid by modifying the data right away.
danbruc··on Safe Lock-free Primitives with iceoryx2's ByteAtomic
Not true, a wait-free algorithm guarantees that a read will complete in a bounded amount of time. And it guarantees that all threads make progress, it is lock-free that only guarantees progress for one thread.

If the value changes frequently, it will get outdated quickly, but that has nothing to do with the synchronization mechanism used. And even if writes happen rarely, there is always a chance that the value you read will be outdated a nanosecond later.

danbruc··on Safe Lock-free Primitives with iceoryx2's ByteAtomic
[...] then the readers will spin forever waiting for the counter to become even again.
danbruc··on Safe Lock-free Primitives with iceoryx2's ByteAtomic
Obstruction-free, lock-free, and wait-free are increasingly strong guarantees for non-blocking synchronization mechanisms. A sequence lock is a blocking synchronization mechanism and therefore provides none of the aforementioned guarantees.
danbruc··on Safe Lock-free Primitives with iceoryx2's ByteAtomic
A common approach to mitigating the described data race without using blocking locks is to utilize a sequence lock.

A sequence lock is a blocking lock. If the writer dies between the two increment operations, then the readers will spin forever waiting for the counter to become even again.

danbruc··on Devtools must be open source
Updating a constant versus a config parameter isn’t all that different if the build is fast.

Not even remotely true except that in both cases you change a number in some text file. If you do it in source code, you have to get the source code, you have to identify the correct line[s], you need a build environment, you might have to reinstall the new version after the build. And on top of this you want to involve a language model in this. The difference in complexity, effort, and resource consumption is orders of magnitude. And we are not even considering that you will have to go through this for each future version to keep your modification included. This is an insane way to change a font size.

danbruc··on The Dunning-Kruger effect may just be a data artefact (2020)
Is any of the raw datasets of such an experiment available? I would like to see a scatter plot of self-assesed score vs actual score instead of the data aggregated into four bins.
danbruc··on Get ready to flee, Americans in ten countries warned
Ohh, you mean when the CIA supported a coup d'état in Iran? No, sorry, that was 73 years ago. When the USA supported Iraq in attacking Iran including the use of chemical weapons in an 8 year long war? No, that was only 46 years ago. You mean when the Iranian people protested against their government and replaced the monarchy with a Islamic republic?
danbruc··on The most official water costs $120k a gallon
Another fun fact - heavy water has a sweet taste.
danbruc··on Algorithms on billion-scale graph using 10GB RAM: I love DataFusion
33M vertices and 1B edges easily fits into memory, if you use 32 bit integers, it will require about 4 GiB of memory. Out of curiosity I just implemented generating a random graph of that size and calculating one page rank iteration on it in the most naive way (20 lines of C#) and it consumed 8.4 GiB of memory and got one iteration done in 4:20 minutes single threaded.
danbruc··on The mean means nothing: data visualization to debug a latency problem
Instead of the CDF I like to use one minus the CDF, the fraction of requests not yet completed at any given time. Then you can make it a log log plot showing the entire tail with details invisible in the CDF because in the CDF the tail is essentially a horizontal line at one.
danbruc··on The Economic Benefit of Refactoring
Don't get me wrong, a function doing five things is bad. I consider code not good if you write if(condition) instead of if (condition) or a +b instead of a + b. Not that it is really bad on its own, but it indicates to me that the code was written with little care and I should probably expect bigger issues.

What I really want to get at is the distinction between leaving the actual code untouched and just moving it a bit around - to other functions, other classes, other files - and having to change the code - from deduplicating to completely rewritting it.

danbruc··on The Economic Benefit of Refactoring
I did not mean it as a metric but as an indicator what was wrong with the code.

- the code is essentially good but all is in one file, you split it up, lines of code stay the same

- the code is essentially good but lacks some structure, for a function that does five things directly, you extract the functionality into five functions and call them from the original function, lines of code goes very slightly up

But once the code is actually bad - code duplication, bad abstractions, inefficient language use, ... - I would generally expect the lines of code to significantly drop. What scenarios are there where the code is actually bad but refactoring does not reduce the lines of code? It is certainly possible but at moment I am having a hard time comming up with a good example.

danbruc··on The Economic Benefit of Refactoring
Interesting that the amount of code remained essentially unchanged. In my experience it is not unusual that refactoring messy code cuts the number of lines in half.
danbruc··on I made a game where you build a CPU from logic gates
To add to this.

- allow drawing wires backwards from sink to source

- allow connecting inputs

Also there is a problem with the tests and the simulator that showed up in the SR latch level. Despite having the correct circuit, the tests failed until I swapped the two NOR gates. I can not reproduce it, but I would guess it has something to do with the component placement order, the update order of the simulator, and how the tests are executed. As the NOR feedback loop has no well-defined initial state, it probably settled in a placement order dependent way that made the tests fail. Maybe Q was already 1 and the test looks for a 0 to 1 transition when enabling S?

danbruc··on Superlogical
No, correct post. But maybe I am misunderstanding the idea behind the post, that is certainly possible.
danbruc··on Superlogical
This reminds me somewhat of OLE, COM, DCOM, ActiveX, ... [1]. You can paste an Excel chart into a Word document and if you update the data in Excel, the chart in Word will update. You can edit the chart in Word using the Excel UI because you are essentially running an Excel instance inside of Word. You can interact with Excel through an API, no need for a human. But it is painful, you can probably imagine the kind of API you need in order to be able to do all the things you can do with the Excel UI.

The idea is amazing, making this work consistently requires effort, and a lot of it. And as only a few applications invested this effort, it only works with a few applications and never really took off outside of Microsoft. I think this used to work with WordPad and maybe even Notepad but it no longer does, you just get an image instead of the chart object in WordPad and nothing at all in Notepad. It is a dying technology.

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

danbruc··on Show HN: I was tired of opening 2 tabs for every HN link, so I made a userscript
Not the author, but this prevents leaking all URLs you are visiting to agolia. Instead of asking Was this URL submitted to Hacker News? you ask Which URLs have been submitted to Hecker News?, store that in a Bloom filter, and then use the Bloom filter to answer the question Was this URL [likely] submitted to Hacker News?
danbruc··on Solving Fermat: Andrew Wiles
There are 120 monomials of degree at most 7 in three variables. If we restrict the coefficients to the integers from -10 to +10, that makes 21^120 possible polynomials. And we need three of them, that makes 10^476. And we would still miss the specific counterexample because it includes a coefficient of 12 outside of our range. So I would say that you will never find this specific counterexample by chance and whether you could accidentally trip over any counterexample really depends on their density. And we have of course not addressed the question why you would search this specific region of the parameter space, why dimension 3, degree 7 and small integer coefficients? There might be good mathematical reason to look at this region, but it is probably non-trivial to even figure out where to look.
danbruc··on What Even Are Microservices?
You do exactly the same in a monolith, functionality is broken into modules with a public API and you can switch out the implementation at any time if you want or have to.
danbruc··on Our position on open-weights models
We do not want to ban using those models, we want to ban the things that enable those models to exist.
danbruc··on Glue bonds to nonstick surfaces and wipes clean with ethanol
Never heard that name, but according to their safety data sheet [1] it is 95+ % dimethylformamide [2]. Not too different from acetone, with a additional dimethylamin group. Acetone-free nail polish remover usually contains primarily ethyl acetate [3] which is also structurally similar.

[1] https://bsi-inc.com/sds_pdf/sds_un_cure.pdf

[2] https://en.wikipedia.org/wiki/Dimethylformamide

[3] https://en.wikipedia.org/wiki/Ethyl_acetate

← PreviousPage 2 of 34Next →