I hereby claim:
-
I am nonsleepr on github.
-
I am nonsleepr (https://keybase.io/nonsleepr) on keybase.
-
I have a public key ASD2K73fCmJ6Ruf8af6CwpPQKYiBD3vk2tdhKIG1qydczgo
| #!/usr/bin/bash | |
| # Requires: | |
| # - xmlstarlet | |
| # - gawk | |
| # - wget | |
| # - xargs | |
| wget -qO - http://techtv.mit.edu/collections/compu-camera/videos.rss | \ | |
| xmlstarlet sel -t -m '//item' -v 'link' -o ',' -v 'enclosure/@url' -n | \ |
| #!/bin/bash | |
| # | |
| # Usage: | |
| # > futurelearn_dl.sh [email protected] password course-name week-id | |
| # Where *[email protected]* and *password* - your credentials | |
| # ,*course-name* is the name from URL | |
| # and *week-id* is the ID from the URL | |
| # | |
| # E.g. To download all videos from the page: https://www.futurelearn.com/courses/corpus-linguistics/todo/238 |
| -- Via http://forums.teradata.com/forum/database/dense-rank | |
| SELECT | |
| department_number, | |
| /*** Syntax not implemented in Teradata ***/ | |
| DENSE_RANK() OVER (PARTITION BY department_number ORDER BY salary_amount), | |
| last_name, | |
| salary_amount | |
| FROM employee; |
| ### Set of functions to download datasets from Kaggle | |
| # Usage: | |
| # | |
| # > train <- kaggle_get_file("train.csv", | |
| # + competition.name = "titanic-gettingStarted", | |
| # + username = "username", | |
| # + password = "password") | |
| # | |
| # > head(train, n = 2) |
| require(plyr) | |
| kfold <- function(df, k, train.f, predict.f) { | |
| progress.bar <- create_progress_bar("text") | |
| progress.bar$init(k) | |
| N <- nrow(df) | |
| subsample.id <- sample(1:k, N, replace = TRUE) | |
| r <- vector(length = N) | |
| ngrams.tokenizer <- function(x, n = 2) { | |
| trim <- function(x) gsub("(^\\s+|\\s+$)", "", x) | |
| terms <- strsplit(trim(x), split = "\\s+")[[1]] | |
| ngrams <- vector() | |
| if (length(terms) >= n) { | |
| for (i in n:length(terms)) { | |
| ngram <- paste(terms[(i-n+1):i], collapse = " ") | |
| ngrams <- c(ngrams,ngram) | |
| } | |
| } |
| # Requires presence of credentials.txt file containing login/password in the following format: | |
| # UserName=my_username&Password=my_password | |
| COMPETITION=diabetic-retinopathy-detection | |
| all: download_files | |
| session.cookie: credentials.txt | |
| curl -o /dev/null -c session.cookie https://www.kaggle.com/account/login | |
| curl -o /dev/null -c session.cookie -b session.cookie -L -d @credentials.txt https://www.kaggle.com/account/login |
| import trio | |
| from multiplexer import Multiplexer | |
| async def reader(mx, key, timeout=100): | |
| print(f'Waiting for "{key}"...') | |
| try: | |
| with trio.fail_after(timeout): | |
| value = await mx[key] | |
| print(f'Got value "{value}" for key {key}') |
I hereby claim:
I am nonsleepr on github.
I am nonsleepr (https://keybase.io/nonsleepr) on keybase.
I have a public key ASD2K73fCmJ6Ruf8af6CwpPQKYiBD3vk2tdhKIG1qydczgo