Skip to content

Instantly share code, notes, and snippets.

View AlexMikhalev's full-sized avatar

Dr Alexander Mikhalev AlexMikhalev

View GitHub Profile
@AlexMikhalev
AlexMikhalev / cpuinfo
Created May 29, 2022 12:20
cat /proc/cpuinfo output for Demo The Pattern server
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 151
model name : 12th Gen Intel(R) Core(TM) i9-12900K
stepping : 2
microcode : 0x18
cpu MHz : 4899.942
cache size : 30720 KB
physical id : 0
@AlexMikhalev
AlexMikhalev / bench.zsh
Last active October 15, 2021 22:03
BERT large QA benchmarks
(venv_the_pattern) ➜ qasearch git:(benchmark) ✗ python3 transformers_plain_bert_qa.py
[101, 2040, 10438, 13434, 6726, 2426, 6001, 1029, 102, 2019, 17727, 2098, 14428, 3372, 2000, 2925, 2913, 1997, 10519, 6726, 1997, 16464, 15245, 2003, 1996, 3768, 1997, 2511, 4725, 2005, 1996, 10788, 1997, 10519, 16464, 12702, 21759, 7088, 19230, 6413, 2005, 4958, 5178, 4328, 10091, 2913, 102]
airborne transmission of respiratory infections is the lack of established methods for the detection of airborne respiratory microorganisms
10.494894326999999 seconds
(venv_the_pattern) ➜ qasearch git:(benchmark) ✗ redis-benchmark -p 30003 -h 127.0.0.1 -n 10 get "bertqa{8YG}_PMC302072.xml:{8YG}:10_Who performs viral transmission among adults"
get bertqa{8YG}_PMC302072.xml:{8YG}:10_Who performs viral transmission among aduget bertqa{8YG}_PMC302072.xml:{8YG}:10_Who performs viral transmission among aduget bertqa{8YG}_PMC302072.xml:{8YG}:10_Who performs viral transmission among aduget bertqa{8YG}_PMC302072.xml:{8YG}:10_Who performs vira
@AlexMikhalev
AlexMikhalev / get-blog-posts.py
Last active September 19, 2021 18:00
Get data from notion
from notion.client import NotionClient
import datetime
import os
from slugify import slugify
import re
import requests
import time
import hashlib
import shutil
import sys
cargo install evcxr_jupyter
jupyter --list
jupyter kernelspec list
jupyter kernelspec uninstall rust
evcxr_jupyter --install
@AlexMikhalev
AlexMikhalev / taury_tray.rs
Created June 15, 2021 11:16
Taury Apps tray icon
fn main() {
let show = CustomMenuItem::new("show".to_string(), "Show");
let hide = CustomMenuItem::new("hide".to_string(), "Hide");
let quit = CustomMenuItem::new("quit".to_string(), "Quit");
let tray_menu_items = vec![
SystemTrayMenuItem::Custom(show),
SystemTrayMenuItem::Custom(hide),
SystemTrayMenuItem::Separator,
SystemTrayMenuItem::Custom(quit),
@AlexMikhalev
AlexMikhalev / inexact-search-aho-corasick.ipynb
Created June 1, 2021 19:24 — forked from sujitpal/inexact-search-aho-corasick.ipynb
Code demonstrating building and querying an Aho-Corasick FSM for inexact search
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
cat data.csv | awk -F',' '{print " SET \""$1"\" \""$2"\" \n"}' | redis-cli --pipe
python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from rediscluster import RedisCluster
>>> import logging
>>> import logging
>>>
>>> from rediscluster import RedisCluster
>>>
@AlexMikhalev
AlexMikhalev / bug_10_05_2021
Created May 10, 2021 13:31
Potential bug report
1775:M 10 May 2021 13:19:53.513 * <rg> langdetect is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
1775:M 10 May 2021 13:19:53.513 * <rg> six is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
1775:M 10 May 2021 13:20:02.307 * <ai> TORCH backend loaded from /usr/lib/redis/modules/backends/redisai_torch/redisai_torch.so
1775:M 10 May 2021 13:20:09.973 * Reading the remaining AOF tail...
1775:M 10 May 2021 13:20:15.081 * DB loaded from append only file: 30.166 seconds
1775:M 10 May 2021 13:20:15.081 * Ready to accept connections
1775:M 10 May 2021 13:20:15.284 # <rg> Failed on XINFO command : got null reply