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
import os | |
from functools import lru_cache | |
import requests | |
import urllib.parse | |
from flask import Flask | |
from flask import request | |
from flask import flash | |
from flask import url_for |
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
#!/bin/bash | |
# Dependencies: imagemagick, i3lock-color-git, scrot | |
# IMAGE=$(mktemp).png | |
# scrot $IMAGE | |
# # convert $IMAGE -level 0%,100%,0.6 -filter Gaussian -resize 30% -define filter:sigma=2.5 -resize 333.33% $IMAGE | |
# convert -scale 10% -scale 1000% $IMAGE $IMAGE | |
# i3lock -i $IMAGE | |
# rm $IMAGE |
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
# github.com/rafi i3status config | |
# i3status configuration file | |
# see "man i3status" for documentation. | |
# It is important that this file is edited as UTF-8. | |
# The following line should contain a sharp s: | |
# ß | |
# If the above line is not correctly displayed, fix your editor first! |
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
# Variables | |
set $mod Mod4 | |
# Colors | |
set $base00 #101218 | |
set $base01 #1f222d | |
set $base02 #252936 | |
set $base03 #7780a1 | |
set $base04 #C0C5CE | |
set $base05 #d1d4e0 |
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
# -*- coding: utf-8 -*- | |
import markovify | |
import codecs | |
# Get raw text as string. | |
with codecs.open("corpus.txt", encoding="utf-8") as f: | |
text = f.read() | |
# Build the model. |
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
#!/bin/bash | |
if [ -z "$1" ] || [ -z "$2" ]; then | |
echo "Usage: scancan.sh <number of scans> <preparation time>" | |
exit | |
fi | |
echo "Waiting $2" | |
sleep $2 |
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
""" | |
Corpus preprocessing script | |
Usage: | |
preprocess.py | |
preprocess.py [<modulo> <modulo_result>] [options] | |
preprocess.py --increment-ner | |
preprocess.py -h | --help | --version | |
Options: |
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
# -*- coding: utf-8 -*- | |
import numpy | |
import cvxopt | |
cvxopt.solvers.options['show_progress'] = False | |
class SVMClassifier(object): |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
import math | |
from simpleai.search import SearchProblem, astar | |
MAP = """ | |
############################## | |
# # # # | |
# #### ######## # # |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
import os | |
import math | |
import random | |
from PIL import Image | |
from simpleai.machine_learning import ClassificationProblem, is_attribute, NaiveBayes, precision, KNearestNeighbors | |
BASE_PATH = os.path.dirname(os.path.abspath(__file__)) |
NewerOlder