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
script = document.createElement('script');script.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js";document.getElementsByTagName('head')[0].appendChild(script); |
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 | |
# grab labeled dataset | |
wget http://downloads.tatoeba.org/exports/sentences.tar.bz2 | |
bunzip2 sentences.tar.bz2 | |
tar xvf sentences.tar | |
# macos only for gshuf | |
brew install coreutils | |
awk -F"\t" '{print"__label__"$2" "$3}' < sentences.csv | gshuf > all.txt |
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
#torchnet | |
git clone https://github.com/torchnet/torchnet.git && cd torchnet | |
~/torch/install/bin/luarocks install rocks/torchnet-scm-1.rockspec | |
#torch-rnn | |
git clone https://github.com/facebookresearch/torch-rnnlib.git && cd torch-rnnlib/ | |
~/torch/install/bin/luarocks make rocks/rnnlib-0.1-1.rockspec . | |
#argcheck | |
~/torch/install/bin/luarocks build https://raw.github.com/torch/argcheck/master/rocks/argcheck-scm-1.rockspec/Users/loretoparisi/torch/install/bin/luarocks build https://raw.github.com/torch/nn/master/rocks/nn-scm-1.rockspec | |
#moses | |
~/torch/install/bin/luarocks build https://raw.github.com/torch/moses/master/rockspec/moses-1.6.1-1.rockspec |
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 : Sujit Pal | |
#Note: this is a python3 updated version of http://sujitpal.blogspot.fr/2014/12/semantic-similarity-for-short-sentences.html | |
# by mathieu Chrétien ([email protected]) | |
#contributor : Mathieu Chrétien | |
from __future__ import division | |
import nltk | |
from nltk.corpus import wordnet as wn |
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
# Output a single frame from the video into an image file: | |
ffmpeg -i input.mov -ss 00:00:14.435 -vframes 1 out.png | |
# Output one image every second, named out1.png, out2.png, out3.png, etc. | |
# The %01d dictates that the ordinal number of each output image will be formatted using 1 digits. | |
ffmpeg -i input.mov -vf fps=1 out%d.png | |
# Output one image every minute, named out001.jpg, out002.jpg, out003.jpg, etc. | |
# The %02d dictates that the ordinal number of each output image will be formatted using 2 digits. | |
ffmpeg -i input.mov -vf fps=1/60 out%02d.jpg |
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
var toCamelCase = function(str) { | |
return str | |
.replace(/\s(.)/g, function($1) { return $1.toUpperCase(); }) | |
.replace(/\s/g, '') | |
.replace(/^(.)/, function($1) { return $1.toLowerCase(); }); | |
} | |
var ucWords = function(str) { | |
return str.toLowerCase().replace(/\b[a-z]/g, function(letter) { | |
return letter.toUpperCase(); |
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
// | |
// WebViewWithProgressIndicatorController | |
// | |
// Created by Vasily Ulianov on 29.11.16. | |
// Copyright © 2016 Vasily Ulianov. All rights reserved. | |
// | |
import Cocoa | |
import WebKit |
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
XO=arr.reduce((obj,v) => obj.this=obj,new Object() ) |
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
var r,words="We don't talk anymore\nWe don't talk anymore\nWe don't talk anymore\nLike we used to do\nWe don't love anymore\nWhat was all of it for?\nOh, we don't talk anymore\nLike we used to do\n\nI just heard you found the one you've been looking\nYou've been looking for" | |
words=words.split(/[\s]+/g); | |
r=[...words.reduce( (m, v) => m.set(v, (m.get(v) || 0) + 1), new Map() )]; | |
console.log(r) |
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
[ /(cash[.,;:']?\s*[.!?]?\s*up[.,;:']?\s*[.!?]?\s*nigga[.,;:']?\s*[.!?]?\s*you)/, | |
/(up[.,;:']?\s*[.!?]?\s*nigga[.,;:']?\s*[.!?]?\s*you[.,;:']?\s*[.!?]?\s*aint)/, | |
/(nigga[.,;:']?\s*[.!?]?\s*you[.,;:']?\s*[.!?]?\s*aint[.,;:']?\s*[.!?]?\s*got)/, | |
/(my[.,;:']?\s*[.!?]?\s*cash[.,;:']?\s*[.!?]?\s*up[.,;:']?\s*[.!?]?\s*nigga)/, | |
/(cash[.,;:']?\s*[.!?]?\s*up[.,;:']?\s*[.!?]?\s*nigga[.,;:']?\s*[.!?]?\s*you)/, | |
/(up[.,;:']?\s*[.!?]?\s*nigga[.,;:']?\s*[.!?]?\s*you[.,;:']?\s*[.!?]?\s*aint)/, | |
/(nigga[.,;:']?\s*[.!?]?\s*you[.,;:']?\s*[.!?]?\s*aint[.,;:']?\s*[.!?]?\s*got)/, | |
/(for[.,;:']?\s*[.!?]?\s*a[.,;:']?\s*[.!?]?\s*ransom[.,;:']?\s*[.!?]?\s*nigga)/, | |
/(a[.,;:']?\s*[.!?]?\s*ransom[.,;:']?\s*[.!?]?\s*nigga[.,;:']?\s*[.!?]?\s*i)/, | |
/(ransom[.,;:']?\s*[.!?]?\s*nigga[.,;:']?\s*[.!?]?\s*i[.,;:']?\s*[.!?]?\s*aint)/, |