Skip to content

Instantly share code, notes, and snippets.

@rdbuf
rdbuf / README.md
Last active July 8, 2019 22:30
Build script for SU2 with AD enabled under MSYS2 using MS-MPI

SU2+AD under MSYS2 with MS-MPI

The script attached below allows one to build SU2 with AD enabled under MSYS2 using MS-MPI. In order to do so, perform the following:

  1. Install the prerequisites:
  2. Run pacman -Syu from inside the fresh installed MSYS2
  3. Run SU2_install.sh under MSYS2 MinGW 64-bit
@rdbuf
rdbuf / forth-02.fth
Last active December 15, 2018 21:00
Языки и методы программирования, 1 семестр
: max_elem_index ( addr len -- idx ) 0 -rot 0 do i cells over + @ -rot 2dup swap cells + @ 2swap -rot < if drop i then swap loop drop ;
create mynumbers 943 , 43 , 7 , 954 ,
: test mynumbers 4 max_elem_index . ;
@rdbuf
rdbuf / calc.cc
Last active November 8, 2018 17:43
A calculator that effectively implements untyped lambda calculus + some syntactic sugar, written by me back in the day. Pratt parsing algorithm is employed.
#include <vector>
#include <memory>
#include <variant>
#include <exception>
#include <algorithm>
#include <string>
#include <cmath>
#include <functional>
#include <unordered_map>
#include <iostream>
@rdbuf
rdbuf / Reverse - Markov algorithm.ipynb
Last active March 10, 2019 10:52
Ad-hoc solution
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdbuf
rdbuf / crackmes.md
Last active February 13, 2021 13:28
@rdbuf
rdbuf / rod-cutting.hs
Last active July 7, 2018 02:49
CLRS#15.1
import Data.Semigroup
main = do
n:c:pricelist <- map (read :: String -> Int) . words <$> getContents
print $ solution n c (undefined:pricelist)
data Optimum = Optimum { value :: Int, lengths :: [Int] } deriving (Show, Eq, Ord)
instance Semigroup Optimum where
a <> b = Optimum (value a + value b) (lengths a <> lengths b)
solution n c pricelist = last optimumByLength where
@rdbuf
rdbuf / 23.hs
Last active March 10, 2019 10:53
Решил ЕГЭ#23!
import Data.List
import Control.Monad
import Data.Monoid
answer = length . filter cond . replicateM 2 . replicateM 9 $ [False,True]
cond [x,y] = and $ [x!!0 || y!!1] <> zipWith (&&) (rows x) (rows y) where
rows = map ((||) <$> not . (!!0) <*> (!!1)) . take 8 . tails
main = print answer
@rdbuf
rdbuf / index.txt
Last active February 13, 2021 14:49
Студенческая жизнь
олимпиады:
Студенческая олимпиада МФТИ по математике, http://rkarasev.ru/news/
Олимпиада НИУ ВШЭ для студентов и выпускников, https://olymp.hse.ru/ma/
Всероссийская студенческая олимпиада по прикладной математике и физике, МФТИ
Студенческая олимпиада по алгебре, МГУ, http://halgebra.math.msu.su/Olympiad/
Заочная олимпиада по комбинаторике, ФПМИ МФТИ, https://vk.com/comb.olymp
Студенческая олимпиада по дискретной математике, ФУПМ МФТИ
Санкт-Петербургская заочная олимпиада по топологии, http://mathcenter.spb.ru/nikaan/math.html, https://vk.com/wall4836_1633
Четвертьфинал Открытого чемпионата мира по программированию ACM ICPC
@rdbuf
rdbuf / learning resources.md
Last active September 25, 2021 10:25
Reading list
Бесов. Лекции по математическому анализу
Иродов. Механика
Кириченко. Термодинамика, статистика и молекулярная физика
Беклемишев. Аналитическая геометрия и линейная алгебра
Sedgewick, Wayne. Algorithms