This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ```{r} | |
| pb <- txtProgressBar(min = 0, max = 20, style = 3) | |
| for(i in 1:20){ | |
| Sys.sleep(0.1) | |
| # update progress bar | |
| setTxtProgressBar(pb, i) | |
| } | |
| close(pb) | |
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % define basic sets: | |
| \newcommand{\R}{\mathbb{R}} % real numbers | |
| \newcommand{\N}{\mathbb{N}} % natural numbers | |
| \newcommand{\Z}{\mathbb{Z}} % integers etc. | |
| \newcommand{\bb}{\mathbb} % blackboard font | |
| %and probability operators | |
| \newcommand{\Pb}[1]{\mathbb{P}(#1)} | |
| \newcommand{\Ex}[1]{\mathbb{E}(#1)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \usepackage{amsmath} | |
| % lazy numbering for aling*: | |
| \newcommand{\numberthis}{\addtocounter{equation}{1}\tag{\theequation}} | |
| %in the document: | |
| \begin{align*} | |
| &\Pb{X_n > n(p + \epsilon)} = \sum_{j = K}^{n} \Pb{X_n = j} \\ | |
| &\leq \sum_{j = K}^{n} \Pb{X_n = K} r_K ^{j-K} | |
| \leq \sum_{j = K}^{\infty} \Pb{X_n = K} r_K ^{j-K} \\ | |
| &= \Pb{X_n = K} \cdot \frac{1}{1 - r_K} \numberthis \label{eq:bound} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \raggedleft $ \square $ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| colnames()%<>% trimws %>% gsub("\\(%\\)", "pp", .) %>% | |
| make.names %>% gsub("\\.+", "\\.", .) | |
| # whitespace from the beginning/end is trimmed | |
| # replaces (%) with a "pp" abbreviation for percentage | |
| # all white chars are subed with a dot | |
| # multiple dots are concatenated to a single one | |
| require(magrittr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plot(sapply(nets, gorder), sapply(nets, gsize), | |
| xlab="vertices", ylab="edges") | |
| text(sapply(nets, gorder), sapply(nets, gsize), labels = netNames, pos = c(3, 4, 4, 4, 4, 2, 3, 2, 3)) | |
| ######### pos: vector of label locations: 1-below, 2-left, 3-above, 4-right; may be just a single number | |
| ######### the same ploting series must be passed to the plot and text. May use with(df, ...) for convenience |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| attr(obj, 'name') <- value | |
| attributes(obj) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| uint64_t size = 0; | |
| for(auto n : neighbours){ | |
| size += n.size() * sizeof(uint32_t); | |
| } | |
| cout<< "Loaded large graph. Size of adj. list is: " << size << endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd release | |
| cmake -DCMAKE_BUILD_TYPE=Debug .. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git checkout filename | |
| git checkout -- filename # if it happend to clash with branch name |