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
# Python 3.8 | |
import math | |
from queue import Queue | |
from collections import Counter | |
class HuffmanCodes: | |
def __init__(self): | |
pass | |
def __huffman_tree_to_table(self, root, prefix, lookup_table): |
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
""" | |
Developed by Vladimir Fadeev | |
(https://github.com/kirlf) | |
Kazan, 2017 / 2020 | |
Python 3.7 | |
The result is uploaded in | |
https://commons.wikimedia.org/wiki/File:AdaptiveBeamForming.png | |
""" |
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
# Input format: JSONEachRow | |
# Note: ClickHouse should works on localhost, or port forwarding should be used in this example: | |
cat <FILE NAME>.json | curl 'http://localhost:8123/?input_format_skip_unknown_fields=1&query=INSERT%20INTO%20<DATABASE NAME>.<TABLE NAME>%20FORMAT%20JSONEachRow' --data-binary @- |
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
%MatLab/Octave | |
clear all; close all; clc | |
%% Initialization | |
% channel parameters | |
sigmaS = 1; %signal power | |
sigmaN = 0.01; %noise power | |
% CSI (channel state information): | |
channel = [0.722-1j*0.779; -0.257-1j*0.722; -0.789-1j*1.862]; |
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 math | |
from collections import deque | |
class Node: | |
""" | |
A node of the binary search tree | |
Attributes | |
__________ |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<mxfile host="app.diagrams.net" modified="2022-01-11T20:22:49.942Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36" etag="24cRRxXGFhsO2GzN6IQK" version="16.2.4" type="device"><diagram id="Svfi9QZZ8QGGwfDbvttr" name="Page-1">7V1bc9o4FP41zLQPZHyTbB6TtN12pu10N7Oz7b7sOFiAU2Oxtihhf/3KWAYsyWDwFVAyk9i6+HI+nauO5IH5OH/9LXIXsy/YQ8HA0LzXgfluYBgjC9K/ScE6LbAcIy2YRr6XFum7gif/P8QKNVa69D0U5xoSjAPiL/KFYxyGaExyZW4U4VW+2QQH+bsu3CkSCp7GbiCW/uV7ZJaWOoa9K/+I/Oksu7MOR2nN3M0aszeJZ66HV3tF5vuB+RhhTNKj+esjChLaZXRJ+30oqN0+WIRCUqbD6o8ngCaf7k1v8sd78PLy0f+0Ho7YZX65wZK9MXtass5IEOFl6KHkKvrAfFjNfIKeFu44qV1RzGnZjMwDVh24zyh4cMc/p5tujzjAEa0KcUjbP0xwSBjGukPPYxLhn4hrxJ4IRQS9Fr6rvqUgHXkIzxGJ1rQJ62CCtAcbdNBkGKx2ENpZ2WwPvm1Dlw2b6fbSO8rSA0bcUwitXSWhDStHaEuXENqRENrQmiK0M7pKQnMjWrdKjmjDaorQui3QFXlUdrJTHJEZnuLQDd7vSh92lNfo2a7NZ4wXjN4viJA1I6m7JDiPBnr1yfe94x/Jpe4AO3v3yq68OVlnJyF93+/7J3u9ktNdt81Z1i99v+SlDoNGaYCX0Zi1iifffvz+8gN9/0igFbiz+d+veJipLjea |
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
LOAD DATABASE | |
FROM mysql://user:password@mysql57:3306/mysql_db | |
INTO postgresql://user:password@pgsql:5432/pg_db | |
CAST type int with extra auto_increment when (< precision 10) to serial drop typemod drop not null, | |
type int with extra auto_increment when (<= 10 precision) to bigserial drop typemod drop not null, | |
type int when (< precision 10) to int drop typemod, | |
type int when (<= 10 precision) to bigint drop typemod, | |
type tinyint with extra auto_increment to serial drop not null, | |
type smallint with extra auto_increment to serial drop not null, |
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
from datetime import datetime | |
import pandas as pd | |
from clickhouse_driver import Client | |
client = Client('localhost') | |
db_name = "db_name" | |
tables_list = ["table_1", "table_2"] | |
db_table_list = ["{db}.{tb}".format(db=db_name, tb=tb) for tb in tables_list] |
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
# coding=utf-8 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import numpy.linalg as LA | |
import scipy.optimize as optim | |
class UnivFitFunc: | |
def __init__(self, err=5, Nmax=1000): |