Posts

Showing posts from March 29, 2019

Geometry problem - areas of triangles (contest math)

Image
1 1 $begingroup$ This problem is from 2019 Math Kangaroo competition for 9th-10th graders that took place last week, problem #29. I was able to solve it using coordinate geometry, both triangles have the same area. However, I do not expect 9th graders to know this method. Is there a simpler solution that I am not seeing? contest-math euclidean-geometry share | cite | improve this question edited 4 hours ago Vasya asked 4 hours ago Vasya Vasya 4,135 1 6 18

Solidity! Invalid implicit conversion from string memory to bytes memory requested

Image
3 pragma solidity ^0.5 contract ProofOfExistence { // ... some code here function proofFor(string memory document) public view returns(bytes32) { return sha256(document); } // ... some more code here } Gives following error : TypeError: Invalid type for argument in function call. Invalid implicit conversion from string memory to bytes memory requested. I am unable to understand why this error is coming. UPDATE : pragma solidity ^0.5; // Proof of Existence contract, version 3 contract ProofOfExistence3 { mapping (bytes32 => bool) private proofs; // store a proof of existence in the contract state function storeProof(bytes32 proof) public{ proofs[proof] = true; } // calculate and store the proof for a document function notarize(string m