Skip to content

Instantly share code, notes, and snippets.

View yobayob's full-sized avatar
🎯
Focusing

Evgenyi yobayob

🎯
Focusing
  • Saint-Petersburg
View GitHub Profile
@yobayob
yobayob / remove_zero.py
Created September 13, 2020 18:54
Для ЯП
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]
#!/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))
package main
import (
"net/http"
"log"
"os"
"encoding/json"
)
type translateRequestSchema struct {
@yobayob
yobayob / model
Created June 26, 2018 12:06
supermodel.ts
import * as mongoose from 'mongoose';
import {
Connection,
connection,
Model,
Schema,
Document,
Error,
} from 'mongoose';
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')
package main
import (
"github.com/yobayob/goest-worker"
"path/filepath"
"os"
"log"
"io"
"crypto/sha256"
"encoding/hex"
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":
package common
import (
"time"
)
type Task func()
type dispatcher struct {
WorkerPool chan chan Task