- Python 3
- Pip 3
$ brew install python3| #!/usr/bin/python3 | |
| # coding: utf-8 | |
| import requests | |
| from bs4 import BeautifulSoup | |
| from scrapy import Selector | |
| import csv | |
| import datetime | |
| # Code example for: | |
| # Hello World - Machine Learning Recipes #1 - Google Developers | |
| # https://www.youtube.com/watch?v=cKxRvEZd3Mw | |
| from sklearn import tree | |
| # Bumpy = 0, Smooth = 1 | |
| features = [[140, 1], [130, 1], [150, 0], [170, 0]] | |
| # Apple = 0, Orange = 1 | |
| labels = [0, 0, 1, 1] |
| """ | |
| This is a batched LSTM forward and backward pass | |
| """ | |
| import numpy as np | |
| import code | |
| class LSTM: | |
| @staticmethod | |
| def init(input_size, hidden_size, fancy_forget_bias_init = 3): |
| <?php | |
| $values = array( | |
| 'true' => true, | |
| 'false' => false, | |
| '1' => 1, | |
| '0' => 0, | |
| '-1' => -1, | |
| '"true"' => "true", | |
| '"false"' => "false", | |
| '"1"' => "1", |
| from pylab import * | |
| from pprint import pprint | |
| def arrayToList(arr): | |
| if type(arr) == type(array([])): | |
| return arrayToList(arr.tolist()) | |
| elif type(arr) == type([]): | |
| return [arrayToList(a) for a in arr] | |
| else: |
| from hashlib import sha1 | |
| import numpy | |
| arr=numpy.zeros((256,256,4)) | |
| sha1(arr) |
| import requests | |
| import sys | |
| for i in range(1,10000): | |
| response = requests.post('http://apply.embed.ly/1', data={'answer': str(i)}) | |
| if response.status_code == 302: | |
| print i | |
| sys.exit(0) |
| (* | |
| * New-iTerm-Window.scpt | |
| * | |
| * Intended for use with QuickSilver | |
| * I mapped option-y to running this script to create | |
| * a new iTerm window on the current workspace | |
| * | |
| * Based on much Googling - very little "original" code here | |
| * Comments/Suggestions to brad.lhotsky@gmail.com | |
| *) |