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 exoplanet as xo | |
import pymc3 as pm | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import theano.tensor as tt | |
with pm.Model() as model: | |
ecs = xo.UnitDisk("ecs", testval=np.array([1e-5, -1.e-5])) | |
ecc = pm.Deterministic("ecc", tt.sqrt(tt.sum(ecs ** 2))) | |
omega = pm.Deterministic("omega", tt.arctan2(ecs[1], ecs[0])) |
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
MODELYEAR | MAKE | MODEL | VEHICLECLASS | ENGINESIZE | CYLINDERS | TRANSMISSION | FUELTYPE | FUELCONSUMPTION_CITY | FUELCONSUMPTION_HWY | FUELCONSUMPTION_COMB | FUELCONSUMPTION_COMB_MPG | CO2EMISSIONS | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2014 | ACURA | ILX | COMPACT | 2 | 4 | AS5 | Z | 9.9 | 6.7 | 8.5 | 33 | 196 | |
2014 | ACURA | ILX | COMPACT | 2.4 | 4 | M6 | Z | 11.2 | 7.7 | 9.6 | 29 | 221 | |
2014 | ACURA | ILX HYBRID | COMPACT | 1.5 | 4 | AV7 | Z | 6 | 5.8 | 5.9 | 48 | 136 | |
2014 | ACURA | MDX 4WD | SUV - SMALL | 3.5 | 6 | AS6 | Z | 12.7 | 9.1 | 11.1 | 25 | 255 | |
2014 | ACURA | RDX AWD | SUV - SMALL | 3.5 | 6 | AS6 | Z | 12.1 | 8.7 | 10.6 | 27 | 244 | |
2014 | ACURA | RLX | MID-SIZE | 3.5 | 6 | AS6 | Z | 11.9 | 7.7 | 10 | 28 | 230 | |
2014 | ACURA | TL | MID-SIZE | 3.5 | 6 | AS6 | Z | 11.8 | 8.1 | 10.1 | 28 | 232 | |
2014 | ACURA | TL AWD | MID-SIZE | 3.7 | 6 | AS6 | Z | 12.8 | 9 | 11.1 | 25 | 255 | |
2014 | ACURA | TL AWD | MID-SIZE | 3.7 | 6 | M6 | Z | 13.4 | 9.5 | 11.6 | 24 | 267 |
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 os | |
import time | |
dirnames = ['classes', 'triggers'] | |
timestamp = '%s' % time.time() | |
for dirname in dirnames: | |
for fname in os.listdir(dirname): | |
fpath = os.path.join(dirname, fname) |
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
#!/usr/local/bin/python3 | |
###################################################################################################################### | |
# Purpose: Generate rule report of all the security groups # | |
# Input Params: None # # | |
# Author: Ramesh # | |
# Doc. Ref: http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.describe_security_groups# | |
###################################################################################################################### | |
from __future__ import print_function | |
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
async uploadVideo ({ request }) { | |
const video = request.file('video'); | |
await video.move(Helpers.tmpPath('uploads'), { | |
name: 'video.mp4', | |
overwrite: false, | |
}); | |
if (!video.moved()) { | |
return video.error(); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#show memory speed | |
sudo lshw -short -C memory | |
# check core frequencies | |
watch -n.1 "cat /proc/cpuinfo | grep \"^[c]pu MHz\"" | |
#run stress test | |
stress --cpu 12 --io 8 --vm 8 --vm-bytes 1024M --timeout 100s |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
function binarySearch(arr, item) { | |
let startIndex = 0; | |
let endIndex = arr.length - 1; | |
while (startIndex < endIndex) { | |
let middleIndex = Math.floor((startIndex + endIndex) / 2); | |
if (arr[middleIndex] === item) { | |
return `Found at index ${middleIndex}`; | |
} |
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 pandas as pd | |
import numpy as np | |
def most_corr(prices): | |
""" | |
:param prices: (pandas.DataFrame) A dataframe containing each ticker's | |
daily closing prices. | |
:returns: (container of strings) A container, containing the two tickers that | |
are the most highly (linearly) correlated by daily percentage change. | |
""" |