docker ps -q -f status=exited
docker rm $(docker ps -q -f status=exited)
docker rm $(docker ps -a -q)
#Mining YouTube using Python & performing social media analysis (on ALS ice bucket challenge) | |
#https://www.analyticsvidhya.com/blog/2014/09/mining-youtube-python-social-media-analysis/ | |
#complete Python script to mine YouTube data. Just replace your key and keyword you want to search | |
from apiclient.discovery import build #pip install google-api-python-client | |
from apiclient.errors import HttpError #pip install google-api-python-client | |
from oauth2client.tools import argparser #pip install oauth2client | |
import pandas as pd #pip install pandas | |
import matplotlib as plt |
""" 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 |
Jupyter notebook as microservice with kernel gateway and docker |
#!/usr/bin/env python | |
# | |
# update-wordpress-page: updates a Wordpress page with the contents | |
# of the input file | |
# | |
# Described on http://free-electrons.com/blog/automated-wp-page-updates/ | |
# Download: git.free-electrons.com/training-scripts/tree/wordpress | |
# | |
# Usage: update-wordpress-page url-base post-id content-file | |
# |
http://www.winwaed.com/blog/2012/04/09/calculating-word-statistics-from-the-gutenberg-corpus/ | |
Following on from the previous article about scanning text files for word statistics, I shall extend this to use real large corpora. First we shall use this script to create statistics for the entire Gutenberg English language corpus. Next I shall do the same with the entire English language Wikipedia. | |
Project Gutenberg is a non-profit project to digitize books with expired copyright. It is noted for including large numbers of classic texts and novels. All of the texts are available for free online. Although the site could be spidered, this is strongly discouraged due to the limited resources of the project. Instead, a CD or DVD image can be downloaded (or purchased); or you can create a mirror. Instructions for doing this are here, and include the following recommend shell command: | |
rsync -avHS --delete --delete-after --exclude '*cache/generated' [email protected]::gutenberg /home/ftp/pub/mirrors/gutenberg | |
1 |
# cheap immitation of %pycat | |
from IPython.core.display import display, HTML | |
from pygments import highlight | |
from pygments.lexers import PythonLexer | |
from pygments.formatters import HtmlFormatter | |
def show(filename): | |
text = !cat $filename | |
text = '\n'.join(text) |
<style type="text/css"> | |
/*! | |
* from: https://sharmamohit.com/css/jupyter.css | |
* why: https://sharmamohit.com/post/jupyter-notebooks-in-blog/ | |
* Twitter Bootstrap | |
* | |
*//*! normalize.css v3.0.2 | MIT License | git.io/normalize */ | |
* | |
* Font Awesome | |
* |
Google sheets v4 is a game changer.
Programmatically format sheet:
Programmatically create forms: