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
object HelloWorld { | |
def main(args: Array[String]) { | |
println("Hello, world!") | |
} | |
} |
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
def foldLeft[B](z: B)(g: (B, A) => B): B |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"codedeploy:RegisterApplicationRevision", | |
"codedeploy:GetApplicationRevision" | |
], | |
"Resource": [ |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:PutObject" | |
], | |
"Resource": [ | |
"arn:aws:s3:::YOUR_S3_BUCKET_NAME/*" |
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
from IPython.display import Image, display, HTML | |
def strip_consts(graph_def, max_const_size=32): | |
"""Strip large constant values from graph_def.""" | |
strip_def = tf.GraphDef() | |
for n0 in graph_def.node: | |
n = strip_def.node.add() | |
n.MergeFrom(n0) | |
if n.op == 'Const': |
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 logging | |
from logging.handlers import RotatingFileHandler | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def foo(): | |
app.logger.warning('A warning occurred (%d apples)', 42) |
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
from torch.autograd import Variable | |
from torch.nn import functional as F | |
class SELU(nn.Module): | |
def __init__(self): |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#define N 16 /* buffer size */ | |
int main(void) { | |
char name[N]; /* buffer */ | |
/* prompt user for name */ | |
printf("What's your name? "); |
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
# Install useful stuff | |
! apt install --yes ssh screen nano htop ranger git > /dev/null | |
# SSH setting | |
! echo "root:carbonara" | chpasswd | |
! echo "PasswordAuthentication yes" > /etc/ssh/sshd_config | |
! echo "PermitUserEnvironment yes" >> /etc/ssh/sshd_config | |
! echo "PermitRootLogin yes" >> /etc/ssh/sshd_config | |
! service ssh restart > /dev/null | |
# Download ngrok | |
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip |
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
# Author Adam Hibble @algomancer | |
import torch | |
import torch.nn.functional as F | |
import torch.nn as nn | |
import tqdm | |
def get_padding(padding_type, kernel_size): | |
assert padding_type in ['SAME', 'VALID'] | |
if padding_type == 'SAME': | |
return tuple((k - 1) // 2 for k in kernel_size) |
OlderNewer