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
| import math | |
| import numpy | |
| import numpy.random as nrand | |
| """ | |
| Note - for some of the metrics the absolute value is returns. This is because if the risk (loss) is higher we want to | |
| discount the expected excess return from the portfolio by a higher amount. Therefore risk should be positive. | |
| """ |
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
| ''' | |
| A simple demonstration of obtaining, modifying and executing code objects in python without relying | |
| on commonly blocked keywords such as exec, compile, etc... | |
| -Patrick Biernat. | |
| ''' | |
| import __builtin__ | |
| mydict = {} |
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
| ssl_session_cache shared:SSL:1m; # 1MB is ~4000 sessions, if it fills old sessions are dropped | |
| ssl_session_timeout 1440m; # Reuse sessions for 24hrs | |
| # Redirect all traffic to SSL | |
| server { | |
| listen 80 default; | |
| server_name www.example.com example.com; | |
| access_log off; | |
| error_log off; | |
| return 301 https://example.com$request_uri; |
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
| import os | |
| import sys | |
| import subprocess | |
| import re | |
| import optparse | |
| import boto | |
| dynamodb_conn = boto.connect_dynamodb(aws_access_key_id='MY_ACCESS_KEY_ID', aws_secret_access_key='MY_SECRET_ACCESS_KEY') | |
| table_name = 'mytable' | |
| dynamodb_table = dynamodb_conn.get_table(table_name) |