975 karma · joined November 6, 2017
handle f ()
| flip () -> (resume true + resume false) / 2.0
Does `handle f ()` call `calculation` and the `| ...` part "injects" the `flip` effect?
I am also quite confused by the part following `| flip ()`. It somehow returns true or false with a probability of 50%? And why does this give you the expected value of the whole calculation function in the end?Please refrain from accusations of someone not having read the article, it's unconstructive and against site guidelines.
I don't know how you come up with a different reading of the nau.ch article. It states (even though it's an inaccuracy as there are still some 1st generation vaccines available as we figured out):
"Der Pockenimpfstoff gilt als erster der Geschichte. Nur nützt das die Schweiz in der aktuellen Situation mit immer mehr Fällen von Affenpocken nicht. Denn hierzulande ist kein Impfstoff zugelassen."
afaik not creating aliased pointers is not a promise you make when marking a pointer as restrict. Only when using that aliased pointer for accesses (in the presence of modifications) can you actually break the promise. To quote cppreference:
"During each execution of a block in which a restricted pointer P is declared (typically each execution of a function body in which P is a function parameter), if some object that is accessible through P (directly or indirectly) is modified, by any means, then all accesses to that object (both reads and writes) in that block must occur through P (directly or indirectly), otherwise the behavior is undefined"
Which part of the program do you believe violates the restrict promise?
I think it's not obvious that it is violated. The question is whether a pointer obtained through an integer round trip is considered to be derived from the original pointer. The author assumes that it is.
I just checked cppreference and it says: "if some object that is accessible through P [marked restrict] (directly or indirectly) is modified, by any means, then all accesses to that object (both reads and writes) in that block must occur through P (directly or indirectly), otherwise the behavior is undefined"
The only accesses I can see are "*x = 0;", "*ptr = 1;" and "return *x;". "*ptr" is an indirect access through "x" by way of an integer round trip. If the orignal program is indeed UB that would mean that pointers built from an integer round trip are not considered (indirect) accesses through the original pointer.
The author assumes that it is an indirect access: "However, the only possibly suspicious part of the original program is a pointer-integer-pointer round-trip – and if casting integers to pointers is allowed, surely that must work. I will, for the rest of this post, assume that replacing x by (int*)(uintptr_t)x is always allowed."
The base contract does not contain any info about the asset the NFT applies to and the metadata extension only allows you to store a name and a URI (which hopefully still works and still points to the object in the future). There is no object hash as far as I can tell.
Afaik there can be several NFTs for the same object (URI) and none of them is inherently more legitimate than the other. You'd need some kind of endorsement by tha artist to know which NFT is the "real" one. But I'm not an expert so please correct my if I'm wrong.
You are quite flexible in specifying the versions of your direct dependencies and you can fix major, minor or patch versions or do even more complex stuff with version ranges (even though I see the latter rarely used in practice).
In addition, different versions of the same crate can coexist (but their types are considered distinct). So if I directly use libparser 1.1.1 but one of my dependencies uses libparser 1.2.3 that's totally fine. The version of my direct dependency won't silently be upgraded (assuming you fixed the minor or even the patch version when specifying that dependency).
But I guess it can not because while the underlying allocation may have space for 100 objects, the high-level container might only have initialized the first 10 objects for example.
Edit: it seems to depend on the kind of button(?)
But soon after it became clear that it is not really possible for me (or any regular "client" as the article calls it) to look at the state of the virtual machine and evaluate view functions myself. The block chain is so large already that we need to rely on big servers which are operated by other people to do this.