Skip to content

Instantly share code, notes, and snippets.

@sotlampr
sotlampr / roboto-slab.patch
Created December 6, 2019 13:30
roboto-slab.patch
diff --git a/PKGBUILD b/PKGBUILD
index 272814d..d65fe82 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,16 +9,16 @@ arch=('any')
url='https://www.google.com/fonts/specimen/Roboto+Slab'
license=('Apache')
depends=('fontconfig' 'xorg-font-utils')
-source=('https://raw.githubusercontent.com/google/fonts/master/apache/robotoslab/LICENSE.txt'
- 'https://raw.githubusercontent.com/google/fonts/master/apache/robotoslab/RobotoSlab-Bold.ttf'
@sotlampr
sotlampr / script.py
Last active April 7, 2019 14:45
lemmy standalone example
import lemmy
import lemmy.rules.da
lemmatizer = lemmy.Lemmatizer(lemmy.rules.da.rules)
# spiste -> ["spise"]
print("spiste -> ", lemmatizer.lemmatize("VERB", "spiste"))
# akvariernes -> ["akvarie"]
print("akvariernes -> ", lemmatizer.lemmatize("NOUN", "akvariernes"))

PROGRAMMER'S CHALLENGE

  1. Go to the directory your current projects reside in
  2. find . -name '*.py'| sed $(( RANDOM % $(find . -name '*.py'| wc -l) ))'!d'
  3. Send this file to the person who challenged you and challenge somebody else
import os
import pandas as pd
import string
import nltk
import nltk.corpus
from nltk.corpus import stopwords
import gensim
from gensim import corpora, models
from time import gmtime, strftime
from collections import Counter
NEWS
====
- Coefficients converted to z-scores (mean == 0.0, std == 1.0)
METHODS:
========
Max features: 10000
TfidfVectorizer, 10000 (1, 6) chars
TfidfVectorizer, 6131 (1, 1) words
TfidfVectorizer, 4193 (2, 2) words
NEWS
====
- Coefficients converted to z-scores (mean == 0.0, std == 1.0)
METHODS:
========
Max features: 10000
TfidfVectorizer, 10000 (1, 6) chars
TfidfVectorizer, 5954 (1, 1) words
TfidfVectorizer, 3256 (2, 2) words
NEWS
====
- Coefficients converted to z-scores (mean == 0.0, std == 1.0)
METHODS:
========
Max features: 10000
TfidfVectorizer, 10000 (1, 6) chars
TfidfVectorizer, 10000 (1, 1) words
TfidfVectorizer, 10000 (2, 2) words
@sotlampr
sotlampr / file.py
Last active January 19, 2018 15:48
EXAMPLE OF CONFLICT
# This demonstrates how to solve a conflict
def my_function(arg):
<<<<<<<<<< MY_CODE
return 2 * args
==========
return 3 * args
>>>>>>>>>> THE_OTHERS_CODE
# So you have to choose one of the two (between <<< and ==== or ==== and >>>>). Save the file and commit with a message.
# cp command, copies a file
# with -r it is recursive, we copy folders also
# / is the hard disk (think like C: in windows)
# USE: cp -r [source_folder(s)] [target_folder]
# if you want to copy '/home/sotiris/myfolder' to your directory (i.e. '/home/fiammetta') you do:
cp -r /home/sotiris/myfolder /home/fiammetta
# or
@sotlampr
sotlampr / script.py
Created October 13, 2016 18:18
CogSci_assignment
import os.path
import urllib.request
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
URLS = ["http://2.110.57.134/Edu/baboon_data_v2.csv",
"http://2.110.57.134/Edu/baboon_data_v3.csv"]