This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Exercises: | |
| Try to change difficulty level in proof of work algorithm and see how long does it takes to compute nonce. | |
| Write a method to validate the chain. | |
| Reward the mining node. | |
| """ | |
| # blockchain.py | |
| import hashlib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function sendMessage(){ | |
| const mainEl = document.querySelector('#main') | |
| const textareaEl = mainEl.querySelector('div[contenteditable="true"]') | |
| if(!textareaEl) { | |
| throw new Error('There is no opened conversation') | |
| } | |
| random_length = Math.floor(Math.random() * 1000) + 1 | |
| textareaEl.focus() | |
| document.execCommand('insertText', false, ' '.repeat(random_length)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer