sergem’s Personal public notebook

Trading data

eodhistoricaldata.com https://eodhistoricaldata.com/ Only EOD data allowed for free users. Historical dividends API provides Ex-dividend date Declaration date Record date Payment date Value Unadjusted Value Dividend currency API for bulk of data for a given day (all companies): https://eodhistoricaldata.com/financial-apis/bulk-api-eod-splits-dividends/

June 10, 2023 · SergeM

Thoughts about the next 10 years. Version 2022

In order to know where to put efforts, time and money one has to understand which areas of technology, science and culture are experiencing break-through and which are stagnating. In a booming sector/country/company everything is helping to reach a success. Even if you are a mediocre specialist you probably gain a good portion of experience and the career can go higher. During a crisis you easlity get unlucky even if you are high-profile expert....

September 10, 2022 · SergeM

OCR in Ubuntu

A working solution to recognize a couple of pages scanned text (or photos with text) in Ubuntu 20: # install tesseract sudo apt install tesseract-ocr # find module with the language you need apt-cache search tesseract-ocr # Let's say we need german. Then we install sudo apt install tesseract-ocr-deu # Install GUI tool sudo apt install ocrfeeder The interface is relatively simple. It may require setting the default language in the settings....

April 20, 2022 · SergeM

Digital color representation

Representation of color is messed up. Here are some articles about terminology. Merging Computing with Studio Video: Converting Between R’G’B’ and 4:2:2 / pdf by Charles Poynton Upon conversion from 8-bit R’G’B’ to 8-bit Y’CBCR, three-quarters of the available colors are lost. Upon 4:2:2 subsampling, half the color detail is discarded. YUV and luminance considered harmful / pdf by Charles Poynton It was standardized for NTSC in 1953, and remains standard for all contemporary video systems, to form luma, denoted Y’, as a weighted sum of nonlinear (gamma-corrected) R’G’B’ components....

February 20, 2022 · SergeM

Image processing cheat sheet

In ImageMagick: convert save the result to a given (new) file mogrify is the same as convert but it performs processing inplace (the input files are overwritten) Strip metadata from jpg file: mogrify -strip f.jpg Rotate according the metadata, then strip: mogrify -auto-orient -strip f.jpg Find jpg and jpeg images, apply orientation from EXIF, remove metadata and resize to 1920 on the longest side preserving the aspect ratio and save to the same files:...

February 16, 2022 · SergeM

Learning Rust

Resources (books, tutorials, etc.) A half-hour to learn Rust - blog post, a great intro into the language. It may be enough to start reading the code, but not enough for writing. Easy Rust — a book about rust Many companies and people now learn Rust, and they could learn faster with a book that has easy English. This textbook is for these companies and people to learn Rust with simple English....

June 21, 2021 · SergeM

IDE for Rust

I started to learn rust, and I needed to set up some IDE to handle my exercises. It seems that VScode has pretty good support for Rust. How to set up VS code to work with rust, including debugging. Install rust-analyzer extension and vscode-lldb extension: code --install-extension matklad.rust-analyzer code --install-extension vadimcn.vscode-lldb rust-analyzer provides a nice UI for running binaries and tests: Also it gives a lot of hints: Note that rust-analyzer doesn’t work together with Rust extension (Rust for Visual Studio Code)....

May 23, 2021 · SergeM

Notes on docker

Docker ARG vs ENV https://vsupalov.com/docker-arg-vs-env/ Running GUI apps in docker ROS GUI in docker: https://tuw-cpsg.github.io/tutorials/docker-ros/ ROS GUI with NVIDIA: https://github.com/dkarunakaran/rviz_docker, https://medium.com/intro-to-artificial-intelligence/rviz-on-docker-bdf4d0fca5b rocker A tool to run docker images with customized local support injected for things like nvidia support. And user id specific files for cleaner mounting file permissions. rocker on github Build arguments example Dockerfile: FROM busybox ARG user USER $user # ... A user builds this file by calling:...

April 25, 2021 · SergeM

Graph algorithms

Shortest path problem Dijkstra’s algorithm fixes a single node as the “source” node and finds shortest paths from the source to all other nodes in the graph, producing a shortest-path tree. Wiki Dijkstra’s algorithm Complexity analysis Wiki On stack overflow: Why does Dijkstra’s algorithm use decrease-key? Actually Implementing Dijkstra’s Algorithm - complexity analysis considering three components of the main loop: time per insert, extract_min, and change_priority operation: O(nT_ins + nT_min + m*T_change)...

February 14, 2021 · SergeM

Data Structures And Algorithms in Python

Data strucures Sources: https://wiki.python.org/moin/TimeComplexity https://www.ics.uci.edu/~pattis/ICS-33/lectures/complexitypython.txt n is the number of elements in the container. k is either the value of a parameter, or the number of elements in the parameter. list It is actually an array (implemented as an array). Operation Average Case Amortized Worst Case Note Copy O(n) O(n) Append O(1) O(1) If the array grows beyond the allocated space it must be copied. In the worst case O(n) Pop last O(1) O(1) Pop intermediate O(n) O(n) Popping the intermediate element requires shifting all elements after k by one slot to the left using memmove....

January 29, 2021 · SergeM