I hereby claim:
- I am leonid-ed on github.
- I am leonided (https://keybase.io/leonided) on keybase.
- I have a public key ASABKy69asMsnQRSChUTFtYgLtzc0YNEwDeOnCiwJIWBkAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
" Inspired by https://vim.fandom.com/wiki/Visual_selection_of_indent_block | |
" This version additionaly goes through empty lines to select also separated blocks | |
" on the same indent level. | |
function SelectIndentOn() | |
let temp_var=indent(line(".")) | |
if temp_var is 0 | return | endif | |
while (line(".") > 1) && | |
\ ((indent(line(".")-1) >= temp_var) || (getline(line(".")-1) is "")) | |
exe "normal k" |
In this article we compared different behavior of static
, inline
and static inline
free functions in compiled binary.
All the following test was done under g++ 7.1.1 on Linux amd64, ELF64.
#pragma once
inline int only_inline() { return 42; }
static int only_static() { return 42; }
class WeightedQuickUnionWithPathCompressionUF(): | |
"""Weighted quick-union with path compression algorithm | |
The original Java implementation is introduced at: | |
https://algs4.cs.princeton.edu/15uf/index.php#1.5 | |
https://www.cs.princeton.edu/~rs/AlgsDS07/01UnionFind.pdf | |
Time complexity: | |
constructor: O(n) | |
union: amortized ~O(1) |
# The MIT License (MIT) | |
# Copyright (c) 2016 Leonid Edrenkin | |
# | |
# This is a Sublime Text 3 plugin that copies selected lines to the clipboard. | |
# You should select text lines and apply command: | |
# view.run_command('copy_lines_to_clipboard') | |
# view.run_command('copy_lines_to_clipboard', {"with_filename": True}) | |
# view.run_command('copy_lines_to_clipboard', {"with_filename": True, "tabsize" : 4}) |
# The MIT License (MIT) | |
# Copyright (c) 2016 Leonid Edrenkin | |
# | |
# This is a Sublime Text 3 plugin that makes and unmakes a numberred list. | |
# You should select text lines and apply one of commands: | |
# view.run_command('make_numberred_list') | |
# view.run_command('unmake_numberred_list') | |
import sublime, sublime_plugin |
# The MIT License (MIT) | |
# Copyright (c) 2016 Leonid Edrenkin | |
# | |
# This is a Sublime Text 3 plugin that makes an adjusted multiline C-macro. | |
# You should select some code and apply one of commands: | |
# view.run_command('make_multi_line_macro') | |
# view.run_command('unmake_multi_line_macro') | |
import sublime, sublime_plugin |
# The MIT License (MIT) | |
# Copyright (c) 2016 Leonid Edrenkin | |
# | |
#!/bin/bash | |
case "$2,$3" in | |
message,HEAD) | |
;; | |
*) |
/* | |
An example of using raw sockets. | |
You can capture packets by tcpdump: | |
tcpdump -X -s0 -i lo -p udp | |
*/ | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <stdio.h> |
<snippet> | |
<content><![CDATA[ | |
#ifdef DEBUG | |
#endif // DEBUG | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>ifdebug</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.c++, source.c</scope> | |
</snippet> |