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 React from 'react' | |
import bindContext from './path/to/bindContext'; | |
export default class SomeComponent extends React.Component { | |
constructor() { | |
super(); | |
// ========== Too verbose ========== | |
// this.toggleEventForm = this.toggleEventForm.bind(this); | |
// this.handleSubmit = this.handleSubmit.bind(this); |
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
/* The Black and Scholes (1973) Stock option formula */ | |
use std::f64; | |
fn black_scholes(putCallFlag:&str, s:f64, x:f64, t:f64, r:f64, v:f64) -> f64 { | |
let d1 = ( (s / x).ln() + (r + v * v / 2.0) * t) / ( v * t.sqrt() ); | |
let d2 = d1 - v * t.sqrt(); | |
NewerOlder