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
# Create a virtual environment using conda | |
conda create -n coursera_dl python=2.7 pip | |
# Get the code | |
git clone https://github.com/coursera-dl/coursera.git | |
cd coursera\ | |
# Install the dependencies (using virtual environment) | |
activate coursera_dl | |
pip install -r requirements.txt |
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
# Create a virtual environment using conda | |
conda create -n edx_downloader python=2.7 pip | |
activate edx_downloader | |
# Install dependencies: | |
pip install youtube-dl | |
pip install beautifulsoup4 | |
# Get the script | |
git clone https://github.com/dmitrime/edx-downloader.git |
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
# script stolen from http://goo.gl/YbQyAQ | |
# install.packages("tm") | |
# install.packages("ggplot2") | |
# install.packages("lsa") | |
# install.packages("scatterplot3d") | |
#install.packages("SnowballC") | |
#if !(require('SnowballC')) then install.packages("SnowballC") | |
library(tm) | |
library(ggplot2) |
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
(\b((https?://|www\.)|[a-z0-9\.-]+?\.(com|co\.uk|org|net|info|ca)(?=[/ \W\b]))[^ \t\r\n<>]*?(?=(([\'\xe2\x80\x9c".?!,:;]|&(amp|lt|gt|quot);)+?)?(\.\.+|[<>]|\s|$))) |
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
"""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 |
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 pymongo.connection import Connection | |
m = Connection() | |
db = m.reddit | |
votes = db.votes | |
cursor = votes.find().skip(0).limit(50000) | |
print "Setup cursor: %s" % cursor |
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
Follow these steps to install the Guest Additions on your Ubuntu virtual machine: | |
1. Login as ubuntu; | |
2. Click on Applications/System/Terminal (or on Applications/Terminal, if you are using the 606.1 Dapper Drake release); | |
3. Update your APT database with sudo apt-get update, and typing your password, if requested; Install the latest security updates with sudo apt-get upgrade; | |
4. Install required packages with sudo apt-get install build-essential module-assistant; | |
5. Configure your system for building kernel modules by running sudo m-a prepare; | |
6. Click on Install Guest Additions… from the Devices menu, then choose to browse the content of the CD when requested. | |
7. Run sudo sh /media/cdrom/VBoxLinuxAdditions.run, and follow the instructions on screen. |
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 multiprocessing import Pool | |
from PIL import Image | |
SIZE = (75,75) | |
SAVE_DIRECTORY = 'thumbs' | |
def get_image_paths(folder): | |
return (os.path.join(folder, f) | |
for f in os.listdir(folder) | |
if 'jpeg' in f) |
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
library(ggplot2) | |
library(gtable) | |
# create example data | |
set.seed(42) | |
dataset_names <- c("Human", "Mouse", "Fly", "Worm") | |
datasets <- data.frame(name = factor(dataset_names, levels=dataset_names), parity = factor(c(0, 0, 1, 0)), v50 = runif(4, max=0.5), y=1:4) | |
data <- data.frame( dataset1 = rep(datasets$name, 4), dataset2 = rep(datasets$name, each = 4), z = runif(16,min = 0, max = 0.5) ) | |
pal <- c("#dddddd", "#aaaaaa") |
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
// (Project -> Edit Project) | |
{ | |
"build_systems": | |
[ | |
{ | |
"name": "Anaconda Python Builder", | |
"selector": "source.python", | |
"shell_cmd": "python -u \"$file\"" | |
} | |
], |
OlderNewer