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 cats.effect.concurrent.{Deferred, Ref} | |
import cats.effect.{ExitCode, IO, IOApp} | |
import fs2.Chunk | |
import scala.concurrent.duration._ | |
import scala.util.Random | |
object FS2Test extends IOApp { |
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 cats.effect._ | |
import monix.eval.Task | |
import monix.execution.Scheduler | |
import org.http4s.HttpApp | |
import org.http4s.server.Server | |
import org.http4s.server.blaze.BlazeServerBuilder | |
import scala.concurrent.ExecutionContext |
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
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 |
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
# Heavily based on Locate plugin by Ulrik Sverdrup <[email protected]> | |
__kupfer_name__ = _("Recoll") | |
__kupfer_actions__ = ( | |
"Recoll", | |
) | |
__description__ = _("Search using Recoll") | |
__version__ = "" | |
__author__ = "Honza Strnad <[email protected]>" |
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
// 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 | |
} | |
) |