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
%% R2014b | |
% Retrieve all factory defaults | |
s = get(0,'factory'); | |
fnames = fieldnames(s); | |
% groupnames = unique(regexp(fnames, 'factory[A-Z][a-z]+','match','once')); | |
% Select those of interest | |
groupnames = { | |
'factoryAnimatedline' | |
'factoryAnnotationpane' |
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
% This file was created by matlab2tikz. | |
% | |
\documentclass[tikz]{standalone} | |
\usepackage{pgfplots} | |
\usepackage{grffile} | |
\pgfplotsset{compat=newest} | |
\usetikzlibrary{plotmarks} | |
\usepgfplotslibrary{patchplots} | |
\usepackage{amsmath} |
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
% This file was created by matlab2tikz. | |
% | |
\documentclass[tikz]{standalone} | |
\usepackage{pgfplots} | |
\usepackage{grffile} | |
\pgfplotsset{compat=newest} | |
\usetikzlibrary{plotmarks} | |
\usepgfplotslibrary{patchplots} | |
\usepackage{amsmath} |
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
% This file was created by matlab2tikz. | |
% | |
\documentclass[tikz]{standalone} | |
\usepackage{pgfplots} | |
\usepackage{grffile} | |
\pgfplotsset{compat=newest} | |
\usetikzlibrary{plotmarks} | |
\usepgfplotslibrary{patchplots} | |
\usepackage{amsmath} |
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
# memory footprint support libraries/code | |
!ln -sf /opt/bin/nvidia-smi /usr/bin/nvidia-smi | |
!pip install gputil | |
!pip install psutil | |
!pip install humanize | |
import psutil | |
import humanize | |
import os | |
import GPUtil as GPU |
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
%matplotlib notebook | |
import pandas_datareader as pdr | |
from sklearn.linear_model import LinearRegression | |
from sklearn.metrics import mean_squared_error | |
# Download gold data (ETF) | |
gld = pdr.get_data_yahoo('GLD',start='1984-01-01') |
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
# Imports here | |
# .... | |
server_bp = Blueprint('main', __name__) | |
@server_bp.route('/') | |
def index(): | |
return render_template("index.html", title='Home Page') | |
@server_bp.route('/login', methods=['GET', 'POST']) |
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
from flask import Flask | |
from config import BaseConfig | |
def create_app(): | |
server = Flask(__name__) | |
server.config.from_object(BaseConfig) | |
register_extensions(server) | |
register_blueprints(server) |
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
# Other dash and not related imports | |
# ... | |
# Import factory method | |
from app import create_app | |
# Method to protect dash views/routes | |
def protect_dashviews(dashapp): | |
for view_func in dashapp.server.view_functions: | |
if view_func.startswith(dashapp.url_base_pathname): |
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
from datetime import datetime as dt | |
import pandas_datareader as pdr | |
from dash.dependencies import Input | |
from dash.dependencies import Output | |
def register_callbacks(dashapp): | |
@dashapp.callback(Output('my-graph', 'figure'), [Input('my-dropdown', 'value')]) | |
def update_graph(selected_dropdown_value): |
OlderNewer