Skip to content

Instantly share code, notes, and snippets.

Honza Strnad hanny24

Block or report user

Report or block hanny24

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View String distances
function leven_damerau(a::AbstractVector, b::AbstractVector, width::Int, fill_fun)
a_n = length(a)
b_n = length(b)
n = max(a_n,b_n)
tmp = Array(Int,n+1,width)
idx = [i for i in 1:width]
for i in 1:n+1
tmp[i, idx[width] - 1] = i-1
for j in 1:width - 2
@hanny24
hanny24 / recoll.py
Created Sep 9, 2013
Quick & dirty recoll support for Kupfer. Just place it to ~/.local/share/kupfer/plugins.
View recoll.py
# Heavily based on Locate plugin by Ulrik Sverdrup <ulrik.sverdrup@gmail.com>
__kupfer_name__ = _("Recoll")
__kupfer_actions__ = (
"Recoll",
)
__description__ = _("Search using Recoll")
__version__ = ""
__author__ = "Honza Strnad <hanny.strnad@gmail.com>"
@hanny24
hanny24 / comp.rs
Created Jun 10, 2013
Simple Scala-like for comprehension for rust
View comp.rs
// Simple Scala-like for comprehension for rust
macro_rules! comp(
// base case, using "map"
(val $id:ident <- $expr:expr $(,if $cond:expr)* $(,let $assign_id:pat = $assign_val:expr)* ,yield $comp:expr) =>
(
($expr)$(.filtered(|&$id| $cond))*.map(|&$id| {
$(let $assign_id = $assign_val;)* $comp
}
)
You can’t perform that action at this time.