Having trouble installing the latest stable version of tmux?
I know, official package for your OS/distro is outdated and you just want the newest version of tmux.
Well, this script should save you some time with that.
- gcc
Having trouble installing the latest stable version of tmux?
I know, official package for your OS/distro is outdated and you just want the newest version of tmux.
Well, this script should save you some time with that.
| set cot=menu,menuone | |
| ino <BS> <BS><C-r>=getline('.')[col('.')-3:col('.')-2]=~#'\k\k'?!pumvisible()?"\<lt>C-n>\<lt>C-p>":'':pumvisible()?"\<lt>C-y>":''<CR> | |
| ino <CR> <C-r>=pumvisible()?"\<lt>C-y>":""<CR><CR> | |
| ino <Tab> <C-r>=pumvisible()?"\<lt>C-n>":"\<lt>Tab>"<CR> | |
| ino <S-Tab> <C-r>=pumvisible()?"\<lt>C-p>":"\<lt>S-Tab>"<CR> | |
| augroup MyAutoComplete | |
| au! | |
| au InsertCharPre * if |
| from math import pow, sqrt | |
| def cosine(ratings1, ratings2): | |
| norm1 = sum([pow(rating,2) for rating in ratings1.values()]) | |
| norm2 = sum([pow(rating,2) for rating in ratings2.values()]) | |
| intersect_keys = filter(lambda x: x in ratings1.keys(), ratings2.keys()) | |
| dot_product = sum([ratings1[key]*ratings2[key] for key in intersect_keys]) | |
| cosine_distance = dot_product/(sqrt(norm1*norm2)) | |
| return cosine_distance |
| def bufferise(defbuf=20, defskip=0): | |
| def decorate(function): | |
| def wrapper(*args, **kwargs): | |
| bufsize = kwargs['bufsize'] if 'bufsize' in kwargs else defbuf | |
| skiplines = kwargs['skiplines'] if 'skiplines' in kwargs else defskip | |
| print 'Bufsize = {}'.format(bufsize) | |
| print 'Skip {} lines'.format(skiplines) | |
| if skiplines: | |
| for i, record in enumerate(function(*args, **kwargs), start=1): | |
| if i > skiplines: |
Picking the right architecture = Picking the right battles + Managing trade-offs
#System Design Cheatsheet
Picking the right architecture = Picking the right battles + Managing trade-offs
##Basic Steps
| package main | |
| import ( | |
| "flag" | |
| "io" | |
| "log" | |
| "net" | |
| ) | |
| func main() { |
| from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer | |
| from sklearn.datasets import fetch_20newsgroups | |
| from sklearn.decomposition import NMF, LatentDirichletAllocation | |
| def display_topics(model, feature_names, no_top_words): | |
| for topic_idx, topic in enumerate(model.components_): | |
| print "Topic %d:" % (topic_idx) | |
| print " ".join([feature_names[i] | |
| for i in topic.argsort()[:-no_top_words - 1:-1]]) |
| # -*- coding: utf-8 -*- | |
| ''' | |
| Functions to read the OpenWordnetPT from RDF files and provide | |
| access to it. | |
| ''' | |
| import rdflib | |
| from six.moves import cPickle |