This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| package main | |
| import ( | |
| "log" | |
| "net/http" | |
| ) | |
| func redirect(w http.ResponseWriter, r *http.Request) { | |
| http.Redirect(w, r, "http://www.google.com", 301) |
| import scala.concurrent.Await | |
| import scala.concurrent.ExecutionContext | |
| import scala.concurrent.Future | |
| import scala.concurrent.blocking | |
| import scala.concurrent.duration.Deadline | |
| import scala.concurrent.duration.Duration | |
| import scala.concurrent.duration.DurationInt | |
| import scala.concurrent.duration.DurationLong | |
| import scala.concurrent.future | |
| import scala.concurrent.promise |
| /* | |
| glog-example | |
| ------------ | |
| background | |
| --- | |
| You probably want to read the source code comments at the top of the glog.go file in | |
| the golang/glog repository on github.com. Located here: https://github.com/golang/glog/blob/master/glog.go | |
| setup |
| object MergeSort { | |
| // recursive merge of 2 sorted lists | |
| def merge(left: List[Int], right: List[Int]): List[Int] = | |
| (left, right) match { | |
| case(left, Nil) => left | |
| case(Nil, right) => right | |
| case(leftHead :: leftTail, rightHead :: rightTail) => | |
| if (leftHead < rightHead) leftHead::merge(leftTail, right) | |
| else rightHead :: merge(left, rightTail) |
| """ Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
| import numpy as np | |
| import cPickle as pickle | |
| import gym | |
| # hyperparameters | |
| H = 200 # number of hidden layer neurons | |
| batch_size = 10 # every how many episodes to do a param update? | |
| learning_rate = 1e-4 | |
| gamma = 0.99 # discount factor for reward |
Install Scala 2.11.8
$ sudo apt-get remove scala-library scala
$ sudo wget www.scala-lang.org/files/archive/scala-2.11.8.deb
$ sudo dpkg -i scala-2.11.8.deb
Check Scala version
$ scala -version
| --- | |
| - name: Create Instance in AWS | |
| hosts: localhost | |
| connection: local | |
| gather_facts: false | |
| vars: | |
| aws_access_key: "xxxxxx" | |
| aws_secret_key: "xxxxxx" | |
| security_token: "xxxxxx" |
| node { | |
| stage 'Checkout and Build' | |
| createVirtualEnv 'env' | |
| executeIn 'env', 'pip install -r requirements.txt' | |
| executeIn 'env', './manage.py test' | |
| executeIn 'env', './manage.py integration-test' | |
| virtualEnv('true') | |
| runCmd('pip install -r requirements.txt') |
| import numpy as np | |
| import tensorflow as tf | |
| import keras as k | |
| from keras.applications.resnet50 import ResNet50 | |
| from keras import backend as K | |
| from keras.layers.core import Flatten, Dense, Dropout, Lambda | |
| from keras.models import Model | |
| from keras.preprocessing import image |