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 fibonacci(n): | |
| x = 0 | |
| y = 1 | |
| for i in range(n): | |
| print x | |
| t = y | |
| y = x + y | |
| x = t | |
| def fibonacci(n): |
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
| # Example Dockerfile | |
| FROM hello-world |
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
| s3_lib_path = os.getenv('S3_LIB_PATH', None) | |
| if s3_lib_path is not None and len(s3_lib_path) > 0: | |
| log.info('[S3 patch] S3_LIB_PATH is defined. Will patch deployment from S3.') | |
| log.info('[S3 patch] S3_LIB_PATH is [{}]'.format(s3_lib_path)) | |
| import boto3 | |
| import botocore | |
| bucket, key = s3_lib_path.split('/', 1) | |
| patch_dir = '/tmp/extensions' | |
| patch_file_target = os.path.join(patch_dir, '.s3_patch.zip') |
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
| library('zoo') | |
| library('urca') | |
| prices <- read.zoo('./priceData.csv', sep=',', FUN = as.yearmon, format='%Y-%m', header=TRUE) | |
| # taking into account short term behaviour, derive the minimum variance hedge by fitting | |
| # a linear model that explains changes in B prices by changes in A prices | |
| # beta coefficient of the regression is the optimal hedge ratio | |
| # intercept is zero as no cash holdings |