Skip to content

Instantly share code, notes, and snippets.

Intent Prediction using Particle Filters @ Rust

Oleksii Kachaiev kachayev

Intent Prediction using Particle Filters @ Rust
View GitHub Profile

Aleph, Part I

A lot has happened these last few weeks. The key focus was on implementing new features, so let's enumerate all of them.


  • #422 "Handle WebSocket handshake timeouts".

Initially implemented by Denis Shilov. Thanks a lot! I've reimplemented the functionality partially to avoid usage of Manifold's timer. Mostly becase of performance considerations. I've also opened the same issue for Netty as this functionality is not covered by built-in websocket protocol handlers. And it was already implemented here by Qin Shicheng.

View manifold-cancel.clj
(require '[manifold.deferred :as d])
(defn long-boring-computation []
(let [result (d/deferred)]
(dotimes [_ 100]
(when-not (d/realized? result)
;; block the thread is still a bad idea :(
(Thread/sleep 1e3)))
(d/success! result "I'm done with this"))
kachayev /
Last active Nov 9, 2020
A few thoughts on Aleph development

Aleph, Async, HTTP, Clojure

I've been working with Aleph rougly for last 5 years, actively contributing to the library for last 2 (or so). I also put some effort into spreading the word about it, including educational tech talks, like "Deep HTTP Dive Throught Aleph & Netty". But the more I talk to people the more confusion I find, mostly about how Aleph works and what can you expect when adding it to your stack. Clojurists Together has recently announced Aleph to get Q1 funding, I think it's a good time to share my priorities and thoughts on development plans that were mentioned in the blog post. Hope the community would find it interesting and helpful.

Aleph describes itself as "asynchronous communication for Clojure" library. And you should probably pay a good portion of your attention to the first word: "asynchronous".

kachayev /
Last active Jul 11, 2017
Lazy developer's approach to do exercises on Propositional Logic
# -*- coding: utf-8 -*-
from tabulate import tabulate
class Var(object):
def __init__(self, name): = name
self.value = None
def bind(self, value):
View async-timeline.clj
(defn fetch-user
(fetch-item id))
(defn fetch-post
(fetch-item id))
(defn timeline-ids
kachayev /
Last active Nov 18, 2020
Channels Are Not Enough or Why Pipelining Is Not That Easy
kachayev /
Last active Oct 13, 2020
Parsing CSS file with monadic parser in Clojure
View kleene.clj
(ns kleene)
;; Inspired by "Regexes, Kleene Algebras and Real Ultimate Power"
;; What do we want to do?...
;; (def p1 (times (Var. "w") (Var. "o") (Var. "w"))
;; (matches? p1 "wow") ;; true
## Alexey Kachayev, 2014
## Link to slides:
## Basic:
## type Parser = String -> Tree
## Composition
## type Parser = String -> (Tree, String)
def heap(el=None):
return (el, None, None)
def union((el1, left1, right1), (el2, left2, right2)):
if el1 is None: return (el2, left2, right2)
if el2 is None: return (el1, left1, right1)
if el1 < el2:
return (el1, union((el2, left2, right2), right1), left1)
return (el2, union((el1, left1, right1), right2), left2)
You can’t perform that action at this time.