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
def remove_zero(l: list) -> list: | |
""" | |
Дан массив целых чисел. Нужно удалить из него нули. Можно использовать только О(1) дополнительной памяти | |
Скорость работы - линейно, доп память не используется | |
""" | |
n: int = 0 | |
for i in range(len(l)): | |
if l[i] != 0: | |
l[n], l[i] = l[i], l[n] |
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
#!/usr/bin/python3 | |
import re | |
import os | |
import sys | |
from tempfile import _get_candidate_names | |
ENV_NAME = "SHULER_PATH" | |
REGEX = re.compile(r"export\s{}\=(\S+)".format(ENV_NAME)) |
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
package main | |
import ( | |
"net/http" | |
"log" | |
"os" | |
"encoding/json" | |
) | |
type translateRequestSchema struct { |
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 * as mongoose from 'mongoose'; | |
import { | |
Connection, | |
connection, | |
Model, | |
Schema, | |
Document, | |
Error, | |
} from 'mongoose'; |
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
class UrlModel(ManagementMixin): | |
# bla bla bla | |
@classmethod | |
def get_clean_uris(cls): | |
from .revisions import Revision | |
from .files import File | |
fstate = Revision.objects.filter(uri=models.OuterRef('pk')).order_by('-number') |
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
package main | |
import ( | |
"github.com/yobayob/goest-worker" | |
"path/filepath" | |
"os" | |
"log" | |
"io" | |
"crypto/sha256" | |
"encoding/hex" |
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 matplotlib.pyplot as plt | |
import dicom | |
import os | |
dicomdir = "~/Downloads/test/CDROM/DICOMDIR" | |
ds = dicom.read_dicomdir(dicomdir) | |
pixel_data = list() | |
for record in ds.DirectoryRecordSequence: | |
if record.DirectoryRecordType == "IMAGE": |
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
package common | |
import ( | |
"time" | |
) | |
type Task func() | |
type dispatcher struct { | |
WorkerPool chan chan Task |