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
| use solana_sdk::{signature::Keypair, signer::Signer}; | |
| use bs58; | |
| fn main() { | |
| let wallet = Keypair::new(); | |
| let public_key_base58 = bs58::encode(wallet.pubkey().to_bytes()).into_string(); | |
| let secret_key_base58 = bs58::encode(wallet.to_bytes()).into_string(); | |
| println!("Public Key (Base58): {}\nSecret Key (Base58): {}\n", public_key_base58, secret_key_base58); | |
| } |
A Python script using Black-Scholes model to calculate total option premiums for given stock options. Customize with your data and parameters.
Components: Black-Scholes Formula: The calculate_option_premium function implements the Black-Scholes formula, taking into account the current stock price (S), option strike price (K), time to expiration (T), risk-free interest rate (r), and volatility of the underlying asset (sigma). It supports both call and put options.
The Black-Scholes formula is a mathematical model used for calculating the theoretical price of European-style options. The formula for the call option is given by:
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
| console.log("%c sylish ash ","color: red; background-color: lightblue; border: solid"); |
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
| const handleSubmit = async e => { | |
| e.preventDefault(); | |
| // @TODO - handle validation | |
| // ... | |
| // @TODO - handle submit based on operation | |
| switch (operation) { | |
| case 'add': | |
| console.log(dataType, state); |
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
| import {cleanup, fireEvent, render} from '@testing-library/react'; | |
| import CheckboxWithLabel from '../CheckboxWithLabel'; | |
| // Note: running cleanup afterEach is done automatically for you in @testing-library/react@9.0.0 or higher | |
| // unmount and cleanup DOM after the test is finished. | |
| afterEach(cleanup); | |
| it('CheckboxWithLabel changes the text after click', () => { | |
| const {queryByLabelText, getByLabelText} = render( | |
| <CheckboxWithLabel labelOn="On" labelOff="Off" />, |