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
public static <T> Validator<T extends Comparable<T>> positiveValidator(T zeroValue) { | |
return value -> { | |
if (zeroValue.compareTo(value) < 0) { | |
return Optional.empty() | |
} | |
else { | |
rerurn Optional.of(String.format("Value must be positive but was '%s'", value)); | |
}; | |
} | |
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
l = (N) => { | |
sum = 0, iter = 1000000; | |
for (let i = 1; i < iter; i++) { | |
var s = 0, | |
j = 0; | |
while (s < N) { | |
s += Math.random(); | |
j++; | |
} | |
sum += j; |
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
package some; | |
import java.time.Clock; | |
import java.util.Objects; | |
import java.util.concurrent.ConcurrentLinkedQueue; | |
import java.util.concurrent.atomic.AtomicReference; | |
import java.util.function.BinaryOperator; | |
/** | |
* SlidingWindowCounter |
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
from typing import List | |
import subprocess | |
import sys | |
def call_and_get_out(command: List[str]): | |
with subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) as p: | |
try: | |
out, err = p.communicate() | |
code = p.poll() |
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
import subprocess | |
import os | |
class VirtualenvAdapter(): | |
def __init__(self, dir, venv_dir_name='.venv'): | |
self.dir = dir | |
self.venv_dir = os.path.join(dir, venv_dir_name) | |
def enabled(self): |
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
trap "exit 1" TERM | |
export TOP_PID=$$ | |
function error() { | |
echo "Error: $1" | |
kill -s TERM $TOP_PID | |
} >&2 | |
HDIR='${HOME}' | |
HHDIR='${HDIR}' |
На основе PGConf India 2020 - Top 10 Mistakes When Migrating From Oracle to PostgreSQL - Jim Mlodgenski - AWS
Настройки Oracle не транслируются 1 к 1 в настройки Postgres. Пример: (SGA == 16Gb) != (shared_buffer == 16Gb).
Нужен в Oracle, не нужен в Postgres.
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
{ | |
"basics": { | |
"name": "Kirill Sulim", | |
"label": "Senior Java Developer", | |
"phone": "+7-912-66-123-16", | |
"url": "https://kirillsulim.github.io/", | |
"summary": "I am senior java developer with 10+ years of experience. I've successfully created and developed projects in many companies, including Yandex an VK. My main goal in development is to create long-term project with good code quality and infrastructure.\n In my free time I'm developing several small open-source development tools written in Python.\n", | |
"profiles": [ | |
{ | |
"network": "Telegram", |
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
from pathlib import Path | |
start = 3 | |
gap = 1 | |
for p in sorted(Path().glob("*.sql"), key=lambda p: p.name, reverse=True): | |
s = p.name.split("_", maxsplit=1) | |
num = int(s[0]) | |
name = s[1] |
OlderNewer