Skip to content

Instantly share code, notes, and snippets.

@matovitch
matovitch / pickset.hpp
Last active April 6, 2022 17:33
container with O(1) insertion, deletion, and pick random
#include <vector>
#include <random>
#include <cstddef>
#include <functional>
#include <unordered_set>
template <typename T, typename H = std::hash<T> >
struct Hasher
{
std::size_t operator()(const T* const pt) const
#ifndef __TOPOSORT_H__
#define __TOPOSORT_H__
#include <unordered_set>
#include <functional>
#include <memory>
#include <vector>
#include "RobinHoodHashtable.hpp"
#include <iostream>
#include <string>
#include <memory>
template <typename T>
union Uninitialized
{
Uninitialized() : _initialized() {}
~Uninitialized() {}
@matovitch
matovitch / menu.elm
Last active September 12, 2016 17:53
import Html as H
import Html.Attributes as HA
import Html.App as App
main : Program Never
main =
App.program
{
init = init,
view = view,
@matovitch
matovitch / menu.css
Last active September 11, 2016 22:37
.Menu
{
position: absolute;
padding: 0em;
margin: 0em;
top: 0em;
left: 0em;
background: #333;
width: 100%;
}
#include <chrono>
struct ScopedChrono
{
ScopedChrono() :
_start(std::chrono::steady_clock::now()) {}
~ScopedChrono()
{
@matovitch
matovitch / tree.css
Last active June 16, 2017 11:32
Css treeview from bisserof (thanks !)
#fontSizeWrapper { font-size: 16px; }
#fontSize {
width: 100px;
font-size: 1em;
}
/* ————————————————————–
Tree core styles
http://coliru.stacked-crooked.com/a/1c4204c255303b2a
0, 2, 1, 4, 3, 5, 8, 6, 7, 9, 12, 10, 11, 13, 14, 18, 16, 20, 15, 17, 19, 24, 22, 26, 21, 23, 25, 27, 32, 29, 31, 33, 35, 28, 30, 34, 40, 37, 39, 41, 43, 36, 38, 42, 44, 50, 47, 53, 45, 46, 48, 49, 51, 52, 54, 60, 57, 63, 55, 56, 58, 59, 61, 62, 64, 65, 72, 68, 71, 74, 77, 66, 67, 69, 70, 73, 75, 76, 84, 80, 83, 86, 89, 78, 79, 81, 82, 85, 87, 88, 90, 98, 94, 102, 92, 96, 100, 104, 91, 93, 95, 97, 99, 101, 103, 112, 108, 116, 106, 110, 114, 118, 105, 107, 109, 111, 113, 115, 117, 119, 128, 123, 127, 131, 135, 121, 125, 129, 133, 120, 122, 124, 126, 130, 132, 134, 144, 139, 143, 147, 151, 137, 141, 145, 149, 136, 138, 140, 142, 146, 148, 150, 152, 162, 157, 167, 154, 156, 158, 160, 164, 166, 168, 170, 153, 155, 159, 161, 163, 165, 169, 180, 175, 185, 172, 174, 176, 178, 182, 184, 186, 188, 171, 173, 177, 179, 181, 183, 187, 189, 200, 194, 199, 204, 209, 191, 193, 195, 197, 201, 203, 205, 207, 190, 192, 196, 198, 202, 206, 208, 220, 214, 219, 224, 229, 211,
P2
32 32
1023
512 543 574 603 632 659 686 711 736 759 782 803 824 843 862 879 896 911 926 939 952 963 974 983 992 999 1006 1011 1016 1019 1022 1023 480 503 535 566 595 624 652 679 704 729 753 776 797 818 838 857 874 891 907 922 935 948 960 971 980 989 997 1004 1009 1014 1018 1021 450 472 511 551 582 602 631 666 693 710 735 765 788 802 823 848 867 878 895 915 930 938 951 966 977 982 991 1001 1008 1010 1015 1020 420 442 488 519 531 562 609 638 648 675 716 741 750 773 807 828 835 854 882 899 905 920 941 954 958 969 984 993 996 1003 1012 1017 392 412 458 468 527 539 570 616 645 651 678 722 747 756 779 812 833 837 856 886 903 909 924 944 957 959 970 986 995 998 1005 1013 364 384 419 438 476 499 547 578 591 620 654 681 701 726 762 785 794 815 839 858 872 889 913 928 933 946 961 972 979 988 1000 1007 338 357 391 426 446 484 507 555 586 594 623 657 684 707 732 768 791 796 817 841 860 876 893 917 932 934 947 962 973 981 990 1002 312 331 371 398 433 454 492 515 529 560 597 626 660 687 713 738 748 771 798 819 845 864 88
P2
32 32
14000
9000 9475 9945 10378 10799 11179 11544 11866 12172 12437 12684 12894 13088 13249 13395 13513 13619 13703 13776 13831 13879 13913 13941 13960 13976 13985 13992 13996 13998 13999 14000 14000 8510 8862 9353 9825 10259 10684 11082 11451 11778 12088 12369 12621 12836 13034 13208 13358 13480 13590 13681 13757 13815 13865 13904 13934 13955 13971 13983 13991 13995 13998 13999 14000 8055 8388 8985 9597 10066 10363 10785 11275 11636 11854 12160 12503 12746 12884 13079 13289 13431 13507 13614 13723 13794 13827 13875 13921 13948 13959 13974 13988 13994 13995 13998 14000 7607 7934 8632 9107 9291 9764 10466 10885 11026 11397 11929 12231 12335 12589 12932 13123 13183 13335 13533 13637 13670 13748 13839 13885 13898 13929 13962 13977 13982 13990 13997 13999 7201 7490 8175 8327 9230 9414 9885 10568 10984 11068 11438 12003 12301 12403 12653 12979 13166 13199 13350 13559 13659 13692 13767 13850 13895 13901 13932 13966 13980 13984 13992 13997 6807 7087 7593 7875 8449 8801 9536 10006 10200 10627 11110 11478 11739 12