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/sh | |
ACTIVE_WINDOW=$(xdotool getactivewindow) | |
if [ -z "${1}" ]; then | |
xdotool search --classname Navigator windowactivate --sync key --clearmodifiers "ctrl+F5" | |
else | |
xdotool search --classname Navigator search --name $1 windowactivate --sync key --clearmodifiers "ctrl+F5" | |
fi |
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/sh | |
usage() { | |
echo "Usage: marknote path" | |
exit -1 | |
} | |
FILE=$1 | |
[ -z "${FILE}" ] && usage |
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
def covar_2d(e, s): | |
"""Returns a 2D covariance matrix with main diagonal in direction e and second diagonal perpendicular to e with proportional length s. | |
Params: | |
------- | |
e: array-like | |
Direction of the main diagonal. | |
s: float | |
Proportional scale of the second diagonal. |
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
import requests | |
from collections import namedtuple | |
class Dirble(object): | |
Category = namedtuple("Category", "id name description") | |
Station = namedtuple("Station", "id name streamurl country bitrate status") | |
StationDetails = namedtuple("StationDetails", "id name streamurl country bitrate status description added urlid website songhistory") | |
Song = namedtuple("Song", "artist title") | |
def __init__(self, key, base_url): |
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
function chol_(A::Matrix, L::Matrix) | |
for i = 1:size(A,1) | |
s = 0 | |
@simd for j = 1:i-1 | |
@inbounds L[i,j] = (A[i,j] - sum([L[i,k]*L[j,k] for k = 1:j-1])) / L[j,j] | |
@inbounds s += L[i,j]^2 | |
end | |
L[i,i] = sqrt(A[i,i] - s) | |
end | |
L |
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
type Perceptron | |
w::Vector{Float64} | |
Perceptron(d::Int) = new(zeros(d)) | |
Perceptron(w::Vector{Float64}) = new(w) | |
end | |
type Winnow | |
w::Vector{Float64} | |
η::Float64 | |
Perceptron(d::Int, η::Float64) = new(ones(d)./d, η) |
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
function forward_difference(c::Matrix) | |
out = zeros(c) | |
@simd for i = 1:size(c,1)-1 | |
@inbounds out[i,:] = c[i+1,:] - c[i,:] | |
end | |
@inbounds out[size(c,1),:] = c[1,:] - c[size(c,1),:] | |
out | |
end | |
function at(c::Matrix, t::Number, Δc::Matrix, cumlen::Vector{Float64}) |
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
module Crossvalidation | |
export KFold, StratifiedKFold, LOO, RandomSplit | |
#== | |
K-Fold cross validation | |
Example (5-Fold CV): | |
KFold(X, y, 5) do X_tr, y_tr, X_te, y_te | |
train!(model, X_tr, y_tr) |
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
-- Euclidean rythm (http://en.wikipedia.org/wiki/Euclidean_Rhythm) | |
function rythm(k,n) | |
local r = {} | |
for i = 1,n do | |
r[i] = {i <= k} | |
end | |
local function cat(i,k) | |
for _,v in ipairs(r[k]) do | |
r[i][#r[i]+1] = v |
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
#include <omp.h> | |
#include <vector> | |
#include <complex> | |
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <exception> | |
#include <string> | |
#include <cstdint> |
NewerOlder