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 gym | |
env = gym.make('CartPole-v0') | |
obs=env.reset() | |
maxs=[obs[i] for i in range(len(obs))] | |
mins=[obs[i] for i in range(len(obs))] | |
def strat(style): | |
global maxs, mins | |
ss=lambda x: 0 | |
if style=="1": |
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 gym | |
env = gym.make('CartPole-v0') | |
def ai(): | |
wts=[-.2,0,1,.4] | |
mms=[0.76464200398541937, 2.3215749215909214, 0.20943257252883613, 2.9815988455023286] | |
obs=env.reset() | |
rwd=0 | |
for i in range(200): | |
move=1 if sum([obs[i]*wts[i]/mms[i] for i in range(len(obs))]) > 0 else 0 |
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 | |
from cryptography.hazmat.primitives.ciphers import (Cipher, algorithms, modes ) | |
from cryptography.hazmat.backends import default_backend | |
def encrypt(key, plaintext, associated_data): | |
# Generate a random 96-bit IV. | |
iv = os.urandom(12) | |
# Construct an AES-GCM Cipher object with the given key and a | |
# randomly generated IV. |
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
var https = require("https"); | |
var fs = require("fs"); | |
var options = { | |
key: fs.readFileSync('cert.key'), | |
cert: fs.readFileSync('cert.crt'), | |
requestCert: false, | |
rejectUnauthorized: false | |
}; |
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
var Twitter = require('twitter'); | |
var client = new Twitter({ | |
consumer_key: process.env.TWITTER_CONSUMER_KEY, | |
consumer_secret: process.env.TWITTER_CONSUMER_SECRET, | |
access_token_key: process.env.TWITTER_ACCESS_TOKEN_KEY, | |
access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET | |
}); | |
client.stream('statuses/filter', {track: 'jaguars'}, function(stream) { |
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 invMod(x, p): | |
return pow(x, p-2, p) | |
def addECC(x1,y1,x2,y2,a,b,p): | |
s = (invMod(x2-x1, p)*(y2-y1)) % p | |
if ((x1 - x2) % p == 0) and ((y1-y2) % p == 0): | |
s=(invMod(2*y1, p)*(3*x1*x1 + a)) % p | |
x3 = (s*s -x1 -x2) %p | |
y3 = (s*(x1-x3) -y1) % p | |
return x3,y3 |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Welcome to the chat</title> | |
</head> | |
<body> | |
<p>Chat screen for MYUSERNAME <span class="lang">LANGUAGEHERE</span></p> | |
<hr> | |
<table border="1"> | |
<col style="width:10%"> |
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
Field Type: prime-field | |
Prime: | |
00:aa:dd:9d:b8:db:e9:c4:8b:3f:d4:e6:ae:33:c9: | |
fc:07:cb:30:8d:b3:b3:c9:d2:0e:d6:63:9c:ca:70: | |
33:08:71:7d:4d:9b:00:9b:c6:68:42:ae:cd:a1:2a: | |
e6:a3:80:e6:28:81:ff:2f:2d:82:c6:85:28:aa:60: | |
56:58:3a:48:f3 | |
A: | |
00:aa:dd:9d:b8:db:e9:c4:8b:3f:d4:e6:ae:33:c9: | |
fc:07:cb:30:8d:b3:b3:c9:d2:0e:d6:63:9c:ca:70: |
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
f=file('parameters','r') | |
lines=f.readlines() | |
f.close() | |
params = {} | |
currentHex='' | |
currentParam='' | |
def h2i(hexLines): | |
if (hexLines == ''): | |
return 0 |
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
This is HTML <?php print_r($data); ?> |