Skip to content

Instantly share code, notes, and snippets.

from math import sqrt
from scipy.stats import norm
import numpy as np
from pylab import plot, show, grid, xlabel, ylabel
def brownian(x0, n, dt, delta, out=None):
x0 = np.asarray(x0)
# For each element of x0, generate a sample of n numbers from a
# normal distribution.
{
"name": "UnifiedSDK",
"version": "0.0.0",
"private": true,
"scripts": {
"build-android": "react-native bundle --platform android --dev false --entry-file js/index.js --bundle-output android/fancylib/src/main/assets/unifiedsdk.bundle --assets-dest android/fancylib/src/main/res",
"build-ios": "react-native bundle --platform ios --dev false --entry-file js/index.js --bundle-output ios/FancyLib/FancyLib/js/unifiedsdk.bundle --assets-dest ios/FancyLib/FancyLib/assets/"
},
"dependencies": {
#import "UnifiedSDK.h"
#import <React/RCTBridge.h>
static RCTBridge * bridge;
@implementation UnifiedSDK
+ (void)setup
{
NSBundle *bundle = [NSBundle bundleForClass: [UnifiedSDK class]];
NSURL *jsCodeLocation = [bundle URLForResource:@"unifiedsdk" withExtension:@"bundle"];
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'FancyLibiOS' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for FancyLibiOS
pod 'React', :path => '../../node_modules/react-native', :subspecs => [
'Core',
{
"name": "UnifiedSDK",
"version": "0.0.0",
"private": true,
"scripts": {
"build-android": "react-native bundle --platform android --dev false --entry-file js/index.js --bundle-output android/fancylib/src/main/assets/unifiedsdk.bundle --assets-dest android/fancylib/src/main/res"
},
"dependencies": {
"react": "^16.6.3",
"react-native": "^0.57.8"
{
"name": "UnifiedSDK",
"version": "0.0.0",
"private": true,
"scripts": {
"build-android": "react-native bundle --platform android --dev false --entry-file js/index.js --bundle-output android/fancylib/src/main/assets/unifiedsdk.bundle --assets-dest android/fancylib/src/main/res"
},
"dependencies": {
"react": "^16.6.3",
"react-native": "^0.57.8"
public class UnifiedSDK {
private static ReactInstanceManager manager;
public static void init(Activity activity) {
if (manager == null) {
manager = ReactInstanceManager.builder()
.setApplication(activity.getApplication())
.setCurrentActivity(activity)
.setBundleAssetName("unifiedsdk.bundle")
.setJSMainModulePath("index")
@littleV
littleV / index.js
Created March 22, 2019 21:43
An example of how to use BatchedBridge in js code
import BatchedBridge from "react-native/Libraries/BatchedBridge/BatchedBridge";
import AppRegistry from 'react-native';
export class CommonInterface {
helloworld(message) {
alert("Hello World\n" + message);
}
}
const exposed = new CommonInterface();
@littleV
littleV / package.json
Created March 22, 2019 21:40
Bare minimal package.json for React Native
{
"name": "FancyLibs",
"version": "0.0.0",
"private": true,
"dependencies": {
"react": "^16.6.3",
"react-native": "^0.57.8"
},
"devDependencies": {
"babel-loader": "7.1.4",
@littleV
littleV / App.js
Created March 22, 2019 20:46
A React Native WebView Example
import React from "react";
import { Button, View, Text, WebView } from "react-native";
import { createStackNavigator, createAppContainer } from "react-navigation";
class HomeScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Home Screen</Text>
<Button