searchsorted(arr, x, 'left') returns the position i such that arr[i-1] < x <= arr[i],
so that i is the first one such that x <= arr[i]. Equivalent to lower_bound in c++
searchsorted(arr, x, 'right') returns the position i such that arr[i-1] <= x < arr[i],
so that i is the first one such that x < arr[i]. Equivalent to upper_bound in c++
This file contains 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
import os | |
def scantree(*paths): | |
for path in paths: | |
if os.path.exists(path): | |
for entry in sorted(os.scandir(path), key=lambda x: x.name.lower()): | |
yield entry | |
if entry.is_dir(follow_symlinks=False): | |
yield from scantree(entry.path) | |
else: |
This file contains 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
diff --git a/src/ex_docmd.c b/src/ex_docmd.c | |
index 9040c0d07..e7f040fc2 100644 | |
--- a/src/ex_docmd.c | |
+++ b/src/ex_docmd.c | |
@@ -1,3 +1,23 @@ | |
+#include <stdio.h> | |
+#include <stdarg.h> | |
+int shouldout = 0; | |
+int mprintf(char *fmt, ...) | |
+{ |
This file contains 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
" test 1 | |
function! Test1a() | |
echo 12345678 | |
let x = execute('echo 1234567890', '') | |
echon '1234' | |
endfunction | |
function! Test1b() | |
echo 12345678 | |
echo 1234567890 |
This file contains 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
import numpy as np | |
from numpy.lib.stride_tricks import as_strided | |
from distutils.version import LooseVersion | |
import mmap | |
import tempfile | |
import shutil | |
import os | |
import uuid | |
import contextlib |
This file contains 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
" Plug 'mattn/gist-vim' | |
Plug 'liushapku/gist-vim' |