Skip to content

Instantly share code, notes, and snippets.

View loguntsov's full-sized avatar
💭
open for offers

Sergey Loguntsov loguntsov

💭
open for offers
  • Russia, Saint-Petersburg
View GitHub Profile
@loguntsov
loguntsov / rbtree.erl
Last active October 20, 2022 08:58
Red black tree implementation in Erlang.
% Fuad Tabba (cs.auckland.ac.nz at fuad OR altabba.org at fuad)
% June, 2008
% Posted at http://www.altabba.org/2008/06/full-red-black-tree-implementation-in.html
% In case anyone might actually want to use this code, I've decided to make it
% public domain, unless there are portions of it that infringe on other people's
% copyrights, in that case those people's permissions must be sought.
% References:-
% http://semanticvector.blogspot.com/2008/05/red-black-tree-in-2-hours.html
Header
"%%"
"%% @Author: Sergey Loguntsov <loguntsov@gmail.com>"
"%%"
"%%".
Nonterminals
main_program exp_el
expression
func_call args
@loguntsov
loguntsov / gist:fbdce14942756f23dfa056429cb1073a
Created November 3, 2021 20:37 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
%% -*- coding: utf-8 -*-
%% @private
%% Automatically generated, do not edit
%% Generated by gpb_compile version 4.14.2
-module(test_pb).
-export([encode_msg/1, encode_msg/2, encode_msg/3]).
-export([decode_msg/2, decode_msg/3]).
-export([merge_msgs/2, merge_msgs/3, merge_msgs/4]).
-export([verify_msg/1, verify_msg/2, verify_msg/3]).
-module(huify).
-export([huify/1]).
-define(cl_vowels(),
[$а, $е, $ё, $и, $о, $у, $ы, $э, $ю, $я]).
-define(cl_consonants(),
[$б, $в, $г, $д, $ж, $з, $к, $л, $м, $н, $п, $р, $с, $т, $ф, $х, $ц, $ч,
$ш, $щ]).
-define(cl_etc(),
defmodule Exporter do
require Logger
def filter(file_from, file_to) do
{ :ok, ets } = :ets.file2tab(file_from)
{ :ok, ets2 } = :ets.file2tab(file_from)
try do
:ets.delete_all_objects ets2
codes = [
:"RqCharMoveStart", :"RqCharMove", :"RqCharMoveStop"
]

AI WEB

This application provides HTTP way for interaction with other parts of system. For this time it uses websocket connection to utilize real-time events what happens in system. Websocket protocol

All interaction going via websocket and uses JSON-like messages. The common structure of input command:

{ cmd : 'some_command', params_for_command }

The common struсture of response:

@loguntsov
loguntsov / stab.py
Last active January 23, 2018 19:43
Stabilization of white paper inside image. It will reduce perspective distortion also. For all questions pls write me on email: loguntsov@gmail.com
import cv, cv2, numpy as np
import sys, math as m
import glob, os
def get_new(old):
new = np.ones(old.shape, np.uint8)
cv2.bitwise_not(new,new)
return new
def remove(contour, n):
/* description: Parses end executes mathematical expressions with strings. */
/* lexical grammar */
%lex
%options case-insensitive
%%
\/\/(.*)\n /* 'COMMENT' */
\/\*(.|\n)*?\*\/ /* 'COMMENT' */
/* description: Parses end executes mathematical expressions with strings. */
/* lexical grammar */
%lex
%options case-insensitive
%%
\/\/(.*)\n /* 'COMMENT' */
\/\*(.|\n)*?\*\/ /* 'COMMENT' */