Skip to content

Instantly share code, notes, and snippets.

View vlkv's full-sized avatar
🏠
Working from home

Vitaly Volkov vlkv

🏠
Working from home
  • none
  • Georgia
View GitHub Profile
@vlkv
vlkv / FFT4g.java
Created January 13, 2020 17:40 — forked from qwasd1224k/FFT4g.java
import static java.lang.Math.atan;
import static java.lang.Math.cos;
import static java.lang.Math.sin;
public class FFT4g {
private int[] ip;
private double[] w;
private int n;
FFT4g(int n) {
@vlkv
vlkv / syslog
Created December 31, 2019 19:30
syslog fragment after hard reset (computer hang up)
Dec 31 22:19:33 blackpearl dbus-daemon[1070]: [system] Reloaded configuration
Dec 31 22:19:36 blackpearl packagekitd[6315]: Parent finished...
Dec 31 22:19:36 blackpearl PackageKit: install-files transaction /217_debdccbb from uid 1000 finished with success after 39943ms
Dec 31 22:19:36 blackpearl PackageKit: resolve transaction /218_acbddbcb from uid 1000 finished with success after 545ms
Dec 31 22:19:37 blackpearl PackageKit: get-details transaction /219_aaebeaed from uid 1000 finished with success after 526ms
Dec 31 22:19:47 blackpearl dbus-daemon[1070]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.107' (uid=1000 pid=11601 comm="/usr/lib/midieditor/MidiEditor " label="unconfined")
Dec 31 22:19:47 blackpearl systemd[1]: Starting Hostname Service...
Dec 31 22:19:48 blackpearl dbus-daemon[1070]: [system] Successfully activated service 'org.freedesktop.hostname1'
Dec 31 22:19:48 blackpearl systemd[1]: Started Hostname S
@vlkv
vlkv / keybindings.json
Last active November 28, 2019 15:21
vscode keybindings
// Place your key bindings in this file to override the defaultsauto[]
[{
"key": "ctrl+alt+left",
"command": "workbench.action.navigateBack"
},
{
"key": "ctrl+alt+-",
"command": "-workbench.action.navigateBack"
},
{
@vlkv
vlkv / System Design.md
Created April 20, 2019 16:51 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@vlkv
vlkv / online_book_reading_sys.pseudocode
Created February 9, 2019 18:59
OO Design: Online Book Reading System
class User {
int id;
String name;
AccountType accountType; // enum
List<Bookmark> bookmarks;
}
class Library {
List<Book> books;
@vlkv
vlkv / NumOfWaysToDecode.java
Last active October 9, 2018 12:14
How many ways to decode
// Problem from https://youtu.be/qli-JCrSwuk
// str = "12023273"
// 'a' = 1
// 'b' = 2
// ...
// 'z' = 26
int numOfWays(String str) {
if (str.length == 0) {
return 1;
}
@vlkv
vlkv / unival_tree.java
Created October 1, 2018 12:20
Universal Value Tree
// We need to find number of universal trees (subtrees) in a tree in O(n) time
// A universal tree - is a tree which has all Nodes with the same value.
class Node {
int value;
Node left;
Node right;
}
public static void main(String[] args) {
Node root = null; // TODO get tree somewhere