This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one
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 json | |
| import os | |
| import time | |
| import requests | |
| from PIL import Image | |
| from StringIO import StringIO | |
| from requests.exceptions import ConnectionError | |
| def go(query, path): | |
| """Download full size images from Google image search. |
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
| # The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
| # | |
| # Current known FCC address ranges: | |
| # https://news.ycombinator.com/item?id=7716915 | |
| # | |
| # Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
| # | |
| # In your nginx.conf: | |
| location / { |
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
| # Author: Nelle Varoquaux, Andrew Tulloch | |
| # Uses the pool adjacent violators algorithm (PAVA), with the | |
| # enhancement of searching for the longest decreasing subsequence to | |
| # pool at each step. | |
| import numpy as np | |
| cimport numpy as np | |
| cimport cython |
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
| #!/bin/sh | |
| version="2.6.3" | |
| priority="20603" | |
| sudo mkdir -p /var/redis /var/log/redis | |
| curl -sL http://redis.googlecode.com/files/redis-${version}.tar.gz | tar zx | |
| cd redis-${version}/ | |
| make | |
| sudo make PREFIX=/usr/local/redis/${version} install |
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
| #!/usr/bin/env python | |
| import sys | |
| Dict = [] | |
| with open('aclImdb/imdb.vocab','r') as f: | |
| for line in f: | |
| Dict.append(line.strip()) | |
| with open('audit.log','r') as f: | |
| f.readline() |
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
| worker_processes 2; | |
| error_log /var/log/nginx/error.log; | |
| pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| use epoll; | |
| } |
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
| #!/bin/bash | |
| # Requires vw (https://github.com/JohnLangford/vowpal_wabbit/wiki/) and | |
| # the IMDB dataset (http://ai.stanford.edu/~amaas/data/sentiment/aclImdb_v1.tar.gz) | |
| cat aclImdb/train/labeledBow.feat | \ | |
| sed -n 's/^\([7-9]\|10\)\s/&/p' | \ | |
| sed -e "s/^\([7-9]\|10\)\s//" | \ | |
| awk '{ print "1 '"'"'pos_" (NR-1) " |features " $0}' > train.vw | |
| cat aclImdb/train/labeledBow.feat | \ |
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 online_mean_variance(iterable): | |
| mN = 0 | |
| mM = 0.0 | |
| mS = 0.0 | |
| for x in iterable: | |
| mN += 1 | |
| nextM = mM + (x - mM) / mN | |
| mS += (x - mM) * (x - nextM) |
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
| """Kernel K-means""" | |
| # Author: Mathieu Blondel <[email protected]> | |
| # License: BSD 3 clause | |
| import numpy as np | |
| from sklearn.base import BaseEstimator, ClusterMixin | |
| from sklearn.metrics.pairwise import pairwise_kernels | |
| from sklearn.utils import check_random_state |