Better HN
topnewbestaskshowjobs
Log inSign up

codedokode

9,867 karma · joined Aug 20, 2015 (11y ago) · 5,528 submissions

PHP developer from Russia.
Submissions

comment 1y ago · link · parent

Standard Google page can use JS and WASM to fingerprint device and detect bots. No-JS page cannot detect bots so it makes sense to shut it down to prevent using it for bot detection bypass.

comment 1y ago · link · parent

Internet marketers can misuse this to send lot of automated requests instead of paying for API access.

comment 1y ago · link · parent

> Does the opposite movement exist?

Japan?

comment 1y ago · link · parent

Convenient - the government always can know who watched what.

comment 1y ago · link · parent

It might be reasonable to protect Mr. Obama's house image. But why not protect commoners' houses equally?

comment 1y ago · link · parent

Unlike humans.

comment 1y ago · link · parent

As for program size, I played with small algorithms (like binary search) on godbolt, and my x86 programs had similar size to RISC-V with compressed instructions. I rarely saw 1-byte instructions, there almost always was at least one prefix.

> e.g. a single 32-byte x86 cache line could have up to 32 instructions where the original RISC-V ISA might only have 8

With compressed instructions the theoretical maximum is 16.

> so they have to deal with the problem too.

Luckily you can determine the length from first bits of an instruction, and you can have either 2 bytes left from previous line, or 0.

comment 1y ago · link · parent

What choices? The main thing that comes to mind is lack of exceptions on integer overflow but you are unlikely meaning this.

comment 1y ago · link · parent

x86 decoding must be a pain - I vaguely remember that they have trace caches (a cache of decoded micro-operations) to skip decoding in some cases. You probably don't make such caches when decoding is easy.

Also, more complicated decoding and extra caches means longer pipeline, which means more price to pay when a branch is mispredicted (binary search is a festival of branch misprediction for example, and I got 3x acceleration of linear search on small arrays when I switched to the branchless algorithm).

Also I am not a CPU designer, but branch prediction with wide decoder also must be a pain - imagine that while you are loading 16 or 32 bytes from instruction cache, you need to predict the address of next loaded chunk in the same cycle, before you even see what you got from cache.

As for encoding efficiency, I played with little algorithms (like binary search or slab allocator) on godbolt, and RISC-V with compressed instruction generates similar amount of code as x86 - in rare cases, even slightly smaller. So x86 has a complex decoding that doesn't give any noticeable advantages.

x86 also has flags, which add implicit dependencies between instructions, and must make designer's life harder.

comment 1y ago · link · parent

I wanted to remind once again that hardware keys are immune to fishing because they check website domain unlike humans.

comment 1y ago · link · parent

I asked ChatGPT to make a system of macros that would generate a struct with given fields (for example: int a, bool b, char *c) and a function that would print the struct contents. Instead of refusing it started inventing recursive macros that were never going to work. It seems LLMs are especially bad with C macros.

If you have access to state-of-art coding assistants, try asking this. You can additionally add a requirement to generate a destructor function (that would free dynamically-allocated fields).

comment 1y ago · link · parent

Sometimes it seems like explaining what I want could take more time than actually editing the code.

For example, imagine if you test a vector-like collection. In every test case dumb LLM creates vector manually and makes inserts/deletes. It could be replaced by adding a helper function that accepts a sequence of operations and returns the processed vector. Furthermore, once you have that function, you can merge multiple tests with parametrization, by having a test function accept a sequence of operation and expected result:

    parametrize('actions, result', (
        # Test that remove removes items from vector
        ([Ins(1, 2, 3, 4), Remove(4)], [1, 2, 3]),
        ...
    )
But it takes time to write this explanation, and dumb LLM might not merge all tests from the first time.

comment 1y ago · link · parent

I can prompt anything but I would prefer it not to make obvious mistakes from the start.

comment 1y ago · link · parent

Also I wanted to add that LLMs (at least free ones) are pretty dumb sometimes and do not notice obvious thing. For example, when writing tests they generate lot of duplicated code and do not move it into a helper function, or do not combine tests using parametrization. I have to do it manually every time.

Maybe it is because they generate the code in one pass and cannot return back and fix the issues. LLM makers, you should allow LLMs to review and edit the generated code.

comment 1y ago · link · parent

LLMs are also good for writing quick experiments and benchmarks to satisfy someone's curiosity. For example, once I was wondering, how much time does it take to migrate a cache line between cores when several processes access the same variable - and after I wrote a detailed benchmark algorithm, LLM generated the code instantly. Note that I described the algorithm completely and what it did is just translated it into the code. Obviously I could write the code myself, but I might need to lookup a function (how does one measure elapsed time?), I might make mistakes in C, etc. Another time a made a benchmark to compare linear vs tree search for finding a value in a small array.

It's very useful when you get the answer in several minutes rather than half a hour.

comment 1y ago · link · parent

As I understood by reading the short description, Parquet is a column-oriented format which is made for selecting data and which is difficult to use for updating (like Yandex Clickhouse).

comment 1y ago · link · parent

The buttons and form inputs are too large compared to standard desktop UI elements.

comment 1y ago · link · parent

Hardware keys (unlike humans) usually check page URL and do not send the data stored by another domain.

comment 1y ago · link · parent

If you have enough USB host controllers, you can pass one into a Windows VM and it will have direct access to the connected audio interface (no latency issues). And if on top of that you have two GPUs, you can pass one into Windows VM as well. If you have only one GPU, passing it around will be tricky (you need to terminate all apps working with GPU before taking it away).

If you plan to run a single application in VM, you can allocate just 3-4 Gb to it.

comment 1y ago · link · parent

Why everyone working with the government doesn't use hardware keys without passwords so that fishing is useless?

comment 1y ago · link · parent

You should not be passing file names in different encodings because other apps won't be able to display them properly. There should be one standard encoding for file names. It would also help with things like looking up a name ignoring case and extra spaces.

comment 1y ago · link · parent

File name is not a blob because it is entered by the user as a text string and displayed for the user as a text string and not as a bunch of hex digits. Also, it cannot contain some characters (like slash or null) so it's not a blob anyway.

And you should be using one specified encoding for file names if you want them to be displayed correctly in all applications. It would be inconvenient if different applications stored file names in different encodings.

For the same reason, encoding should be specified in libraries documentation for all functions accepting or returning strings.

comment 1y ago · link · parent

But for matrix multiplication, isn't compute more important, as there are N³ multiplications but just N² numbers in a matrix?

Also I don't think power consumption is important for AI. Typically you do AI at home or in the office where there is lot of electricity.

comment 1y ago · link · parent

How much RAM it is using by the way? I see 30B, but without knowing precision it is unclear how much memory one needs.

comment 1y ago · link · parent

Is this legal: scan billions of pirated books, train a LLM on them and generate billion public domain books with it so that nobody ever needs copyrighted books anymore?

Also if there is a software library with annoying Stallman-style license, can one use LLM to generate a compatible library but in a public domain or with commercial license? So that nobody needs to respect software licenses anymore? Can we also generate a free Photoshop, Linux kernel and Windows this way?

comment 1y ago · link · parent

The slow speed is for using slirp4netns, not containers in general.

comment 1y ago · link · parent

File name is a string, not a blob.
1
383940
185