This file contains 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
A(w) = Ae(w^2) + w * Ao(w^2) |
This file contains 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
Ae(y) = a0 + a2y + a4y^2 + a6^y3 + ... + a(n-2)y^(n-2/2) | |
Ao(y) = a1 + a3y + a5y^2 + a6^y3 + ... + a(n-1)y^(n-2/2) |
This file contains 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
a0 + a2x^2 + a4x^4 + a(n-2)x^(n-2) | |
+ a1x + a3x^3 + a4x^4 + a(n-1)x^(n-1) |
This file contains 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
A(x) = a0 + a1x + a2x^2 + ... + a(n-1)x(n-1) |
This file contains 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
x = 0, then f(x) = 5 | |
x = 1, then f(x) = 8 | |
x = 2, then f(x) = 13 |
This file contains 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
class App extends React.Component { | |
// Encapsulate 'appData' context as props for all children | |
renderChildrenWithContextAsProps() { | |
return React.Children.map(this.props.children, (child) => { | |
return React.cloneElement(child, { | |
appData: this.context.appData | |
}); | |
}); | |
}; |
This file contains 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
window['MY_APP'] = window['MY_APP'] || (() => { | |
return { | |
initialize: (config) => { | |
ReactDOM.render( | |
<Provider appData={config.appData}> | |
<Router history={browserHistory}> | |
{ routes } | |
</Router> | |
</Provider>, | |
document.getElementById('root') |
This file contains 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
<html> | |
<body> | |
<div id="root"><%- renderedRoot %></div> | |
<script src="/app.js"></script> | |
<script> | |
var config = { | |
appData: <%-JSON.stringify(appData)%> | |
}; | |
MY_APP.initialize(config); | |
</script> |
This file contains 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
res.render('index', { | |
renderedRoot: ReactDOMServer.renderToString( | |
<Provider appData={appData}> | |
<RouterContext {...props}/> | |
</Provider> | |
), | |
appData: appData | |
}); |
This file contains 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
class Provider extends React.Component { | |
getChildContext() { | |
return {appData: this.props.appData}; | |
} | |
render() { | |
return( | |
<div> | |
{this.props.children} | |
</div> |