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
""" | |
Passing through a Windows registry key entry | |
Provide a needed registry key and a sub_key you want to retrieve values from | |
""" | |
path = r'HARDWARE\DEVICEMAP...' | |
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, path) as key: | |
sub_keys, values, modified = winreg.QueryInfoKey(key) | |
for i in range(values): |
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
:: Use Notepad++ Run dialog | |
cmd /K cd /D $(CURRENT_DIRECTORY) && pdflatex $(FILE_NAME) |
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
-- For example we have such table: | |
-- Table | |
-- id parent_id | |
-- ------------- | |
-- 0 NULL | |
-- 1 0 | |
-- 2 0 | |
-- 3 1 | |
-- 4 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
CREATE VIEW anc_and_des AS | |
SELECT | |
m.*, | |
-- Count all descendats of a vertice | |
( SELECT COUNT(*) | |
FROM KeywordLtree AS d | |
WHERE m.path @> d.path | |
) AS descendants, | |
-- Count all ancestors of a vertice | |
( SELECT COUNT(*) |
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
#include <regex> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
class RegExpSearch { | |
public: | |
static std::smatch check_string(const std::regex &re, const std::string &s) { | |
std::smatch matches; |
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
class SmallAllocator { | |
private: | |
union Header { | |
using Align = long; | |
struct { | |
Header *next; | |
size_t size; | |
} s; | |
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
#include <iostream> | |
#include <chrono> | |
#include <fstream> | |
#include <array> | |
#include <random> | |
#include <cstddef> | |
void key_gen(std::ofstream& fout); | |
int main() { |
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
#include <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <dirent.h> | |
// as a directory name in Linux cannot be greater than 256 | |
// characters | |
#define MAX_INPUT_SIZE 256 |
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
@echo off | |
rem update system Python packages on Windows | |
FOR /F "usebackq" %%p IN (`pip list -o`) DO pip install -U %%p |
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
# Возможный вывод | |
# x-------------------------------------------------x | |
# | -- -- -- -- -- -- -- -- | | |
# || | | | | | | | | | | | | || | |
# || | | | | | | | | | | | | || | |
# | -- -- -- -- -- -- -- | | |
# || | | | | | | | | | | | || | |
# || | | | | | | | | | | | || | |
# | -- -- -- -- -- -- -- | | |
# x-------------------------------------------------x |
OlderNewer