Skip to content

Instantly share code, notes, and snippets.

View DanilAndreev's full-sized avatar
🙃
nevertheless

Danil Andreev DanilAndreev

🙃
nevertheless
View GitHub Profile
@DanilAndreev
DanilAndreev / FixCLionCMakeMissing.md
Last active January 10, 2024 13:25
Fixing CLion CMake tab missing

Add to .idea/misc.xml

<project version="4">
  ...
  <component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
  ...
</project>   

Thanks for solution to Martin Weber.

@DanilAndreev
DanilAndreev / cli_parser.py
Created November 10, 2021 13:29
Simple CLI parser.
import sys
class ProgramArguments:
def __init__(self):
self.args = []
self.flags = dict()
def is_set(self, flag: str) -> bool:
return str in self.flags
@DanilAndreev
DanilAndreev / DockerCheatsheet.md
Last active September 22, 2021 14:55
Docker cheatsheet

Docker cheat sheet

linux-logo docker-logo

Remove all images at once

docker rmi $(docker images -q)
@DanilAndreev
DanilAndreev / event_emitter.hpp
Last active October 5, 2021 14:51
C++ basic event system example
#ifndef EVENT_EMITTER_HPP
#define EVENT_EMITTER_HPP
#include <string>
#include <map>
#include <unordered_set>
namespace events {
class event_emitter;
@DanilAndreev
DanilAndreev / maya2019install.sh
Created June 4, 2021 12:20 — forked from egetun/maya2019install.sh
Autodesk Maya 2019 Installation Bash Script v1.0 for Ubuntu 18.04 / Tested on KDE Neon 5.14
#!/bin/bash
#Deniz Ege Tunçay, 2019
#nrtkbb, 2018
#Neal Burger, 2017
#Autodesk Maya Installation Bash Script v1.0 for Ubuntu 18.04 based Linux Distributions
#if you have any issues, feel free tweet me // @egetun
#Make sure we’re running with root permissions.

Kruskal's algorithm (Minimum spanning tree)

Introduction

Kruskal's algorithm - efficient algorithm for constructing the minimum spanning tree of a weighted connected undirected graph. The algorithm is also used to find some approximations for the Steiner problem.

Task

The algorithm solves the problem of finding the minimum spanning tree (MST).

@DanilAndreev
DanilAndreev / Linux docker install script.md
Last active April 28, 2021 12:43
Docker setup bash script

Linux docker install script

Overview

This script will automatically install docker and docker-compose and configure them for use without command sudo.

Usage

  1. Copy setup.sh to your OS in any available way.

Finding paths on a 2D map (Dijkstra and A* algorithms)

Introduction

In this article, I want to talk about one of the easiest ways to find paths for a two-dimensional map. I do not take into account the greedy search algorithm because of its simplicity and not optimality. Today we will talk about the algorithm for finding the shortest paths from one vertex of the graph to all the others, proposed by the Dutch scientist Edsger Wybe Dijkstra. Also, I will show you A* algorithm, based on Dijkstra.

@DanilAndreev
DanilAndreev / Rainbow tables (hash-chains).md
Last active February 13, 2024 09:13
Rainbow tables (hash-chains)

Rainbow tables

Introduction

A lot of water has flowed under the bridge since then, when the theme of rainbow tables was at its peak, but, nevertheless, the idea is entertaining. It is about this kind of intricate tables that I want to tell you.

Theory

Brute force method

@DanilAndreev
DanilAndreev / Reverse Polish Notation (RPN).md
Last active May 25, 2021 18:58
Reverse Polish notation converting and calculating

Reverse Polish Notation (RPN)

There is an ancient tradition in mathematics to place an operator between the operands (x + y) rather than after the operands xy+. Form with an operator between operands is called infix notation. The form with an operator after the operands is called postfix, or Reverse Polish notation. It has a number of advantages over infix notation when expressing algebraic formulas:

  1. Any formula can be expressed without parentheses.
  2. It is convenient for calculating formulas on stacked machines.
  3. Infix operators have precedence that is arbitrary and undesirable.