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
import glob | |
import os | |
import subprocess | |
def main(): | |
base_dir = os.path.abspath('d:/abooks') | |
ffmpeg_path = os.path.abspath('C:/tools/ffmpeg/bin/ffmpeg.exe') | |
pattern = os.path.join(base_dir, '**', '*.m4b') | |
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
armaSearch = function( | |
xx, | |
minOrder=c(0,0), | |
maxOrder=c(5,5), | |
trace=FALSE ) | |
{ | |
bestAic = 1e9 | |
len = NROW( xx ) | |
for( p in minOrder[1]:maxOrder[1] ) for( q in minOrder[2]:maxOrder[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
garchAutoTryFit = function( | |
ll, | |
data, | |
trace=FALSE, | |
forecast.length=1, | |
with.forecast=TRUE, | |
ic="AIC", | |
garch.model="garch" ) | |
{ | |
formula = as.formula( paste( sep="", |
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
svmComputeOneForecast = function( | |
id, | |
data, | |
response, | |
startPoints, | |
endPoints, | |
len, | |
history=500, | |
trace=FALSE, | |
kernel="radial", |
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
import dshelper as dsh | |
import numpy as np | |
import os | |
import pandas as pd | |
import sys | |
import time | |
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis as QDA | |
from sqlalchemy import create_engine, MetaData |
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
#!/bin/bash -x | |
echo "Script started"; | |
echo "Downloading the Ranger policy patch script"; | |
wget -O /tmp/patch_policy_esp.py https://hdiconfigactions.blob.core.windows.net/linuxhdiplclusterconfigactionv01/patch_policy_esp.py | |
sudo python /tmp/patch_policy_esp.py | |
echo "Scripts Finished" |
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
armaTryFit = function( | |
ll, | |
data, | |
trace=FALSE, | |
includeMean=TRUE, | |
withForecast=TRUE, | |
forecastLength=1 ) | |
{ | |
formula = as.formula( paste( sep="", | |
"xx ~ arma(", ll[1], ",", ll[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
require(quantmod) | |
prepare.indicator = function(close, indicator, roc.n, normalize=FALSE, func=mean) { | |
rets = ROC(close, type="discrete", n=roc.n) | |
if(normalize) { | |
# Normalize the returns to daily | |
rets = ((1 + rets) ^ (1/roc.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
findBestArma = function( | |
xx, | |
minOrder=c(0,0), | |
maxOrder=c(5,5), | |
trace=FALSE ) | |
{ | |
bestAic = 1e9 | |
len = NROW( xx ) | |
for( p in minOrder[1]:maxOrder[1] ) for( q in minOrder[2]:maxOrder[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
require(quantmod) | |
require(SIT) | |
dvi.indicator = function(prices) { | |
dvi = TTR:::DVI(prices)[,3] | |
indicator.long = ifelse(dvi <= 0.5, 1, 0) | |
indicator.short = ifelse(dvi > 0.5, -1, 0) | |
indicator = reclass(cbind(indicator.short + indicator.long), prices) |
NewerOlder