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 flask_sqlalchemy import SQLAlchemy | |
| app = Flask(__name__) | |
| try: | |
| app.config.from_object("config") | |
| except: | |
| pass | |
| if app.config["SQLALCHEMY_DATABASE_URI"].startswith("sqlite"): |
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 inline | |
| import numpy as np | |
| import pandas as pd | |
| from matplotlib import pyplot as plt | |
| plt.style.use("ggplot") | |
| plt.rcParams["font.size"] = 14 | |
| plt.rcParams["figure.figsize"] = 10, 6 |
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
| $(function () { | |
| $(document).ready(function () { | |
| // Build the chart | |
| Highcharts.setOptions({ | |
| colors: ['#4572A7', '#AA4643', '#89A54E', '#80699B', '#3D96AE', '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92', '#0000cd', '#dda0dd'] | |
| }); | |
| $('#container').highcharts({ |
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
| group 'com.example' | |
| version '1.0' | |
| apply plugin: "java" | |
| apply plugin: "scala" | |
| apply plugin: "application" | |
| sourceCompatibility = 1.8 | |
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
| def colorHist(img): | |
| size = img.size / 3.0 | |
| ret = {} | |
| color = ('b','g','r') | |
| for i,col in enumerate(color): | |
| histr = cv2.calcHist([img],[i],None,[100],[0,256]) | |
| ret[col] = histr.flatten() / size | |
| return ret |
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
| __author__ = 'du' | |
| from chainer import FunctionSet, functions as F, optimizers | |
| from skchainer import ChainerClassifier | |
| class MultiLayerPerceptron(ChainerClassifier): | |
| def _setup_network(self, **params): | |
| print(params) | |
| network = FunctionSet( |
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
| options(repos=structure(c(CRAN="http://cran.ism.ac.jp/"))) | |
| Sys.setenv(MAKEFLAGS = "-j4") |
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 itertools import islice, chain | |
| def batches(iterable, batchsize=10): | |
| it = iter(iterable) | |
| while True: | |
| batch = islice(it, batchsize) | |
| yield chain([next(batch)], batch) |
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
| alias hls='hdfs dfs -ls' | |
| alias hlsr='hdfs dfs -lsr' | |
| alias hdu='hdfs dfs -du' | |
| alias hdus='hdfs dfs -dus' | |
| alias hcount='hdfs dfs -count' | |
| alias hmv='hdfs dfs -mv' | |
| alias hcp='hdfs dfs -cp' | |
| alias hrm='hdfs dfs -rm' | |
| alias hrmr='hdfs dfs -rmr' | |
| alias hexpunge='hdfs dfs -expunge' |
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
| { | |
| "template": "*", | |
| "settings":{ | |
| "number_of_shards" : 3, | |
| "index":{ | |
| "analysis": { | |
| "analyzer": { | |
| "default": { | |
| "type": "kuromoji_neologd" | |
| } |