Skip to content

Instantly share code, notes, and snippets.

View korobochka's full-sized avatar

Ilya Korobitsyn korobochka

View GitHub Profile
import std.stdio;
import std.parallelism;
import std.process;
import std.file;
int main()
{
auto f = File("ids.txt");
auto tp = new TaskPool(32);
import std.stdio;
/+
int bins(int[] arr, int what, int left = 0, int right = -1)
{
if(right == -1) right = cast(int)arr.length;
int l = left;
int r = right;
if(l >= r) return -1;
int m = (l + r) / 2;
#include <stdio.h>
long long int arr[77];
void main()
{
arr[0] = 1;
arr[1] = 1;
int n;
for(n = 0; n < 77; n++)
{
if(n > 1) arr[n] = arr[n - 1] + arr[n - 2];
/home/korobochka korobochka@korobochka-desktop% traceroute srv038.infobox.ru
traceroute to srv038.infobox.ru (77.221.130.38), 30 hops max, 60 byte packets
1 www.asusnetwork.net (192.168.1.1) 0.426 ms 0.586 ms 0.842 ms
2 95-27-64-1.broadband.corbina.ru (95.27.64.1) 4.751 ms 4.870 ms 4.983 ms
3 * * *
4 bmor19-bb-be2.spb.corbina.net (85.21.225.40) 12.002 ms 12.874 ms 12.968 ms
5 m9-crs-be7.corbina.net (78.107.184.212) 15.786 ms 16.096 ms 16.214 ms
6 m9-bb-po5.corbina.net (78.107.184.216) 13.122 ms 9.503 ms 9.961 ms
7 62.205.161.194 (62.205.161.194) 10.654 ms 10.917 ms 11.555 ms
8 80-64-96-117.rascom.net (80.64.96.117) 18.287 ms 80-64-96-13.rascom.net (80.64.96.13) 17.424 ms 17.953 ms
package unitleak;
public class LeakAgentInterface {
private static int engaged;
private static native void _someMethod();
public static void someMethod() {
if(engaged != 0)
{
System.out.println("JAVA: calling native method");
_someMethod();

Тема работы: отслеживать, что все объекты, созданные в рамках юниттеста, собираются в конце него (что не происходит утечек памяти при повторных запусках теста).

Пример с JUnit:

public class SomeLeak {
    static ArrayList<String> strings = new ArrayList<String>();

    public void doSomething() {
        String s = "Some leaking string " + strings.size();
 strings.add(s);
@korobochka
korobochka / Readme.md
Created February 2, 2017 16:47
Data Structures exam

Orthogonal Range Query

Реализована следующая структура данных на языке D (dlang.org):

  • Orthogonal Range Query: статическая задача в R^d c O(log^(d-1) n) на запрос

В качестве основного источника теории использовались эти слайды: http://www.cs.ucsb.edu/~suri/cs235/RangeSearching.pdf

Компиляция с помощью DMD (http://dlang.org/download.html#dmd , использовалась версия DMD64 D Compiler v2.072.2):

@korobochka
korobochka / decorators.ts
Last active January 11, 2019 14:57
Allure 2 Typescript step decorators
import { allure } from "../conf/protractorConf"; // export AllureInterface from the config file with onPrepare etc.
export function step(description: string): (...args: any[]) => TypedPropertyDescriptor<any> {
return (target: Object, key: string | symbol, descriptor: TypedPropertyDescriptor<any>): TypedPropertyDescriptor<any> => {
const original = descriptor.value;
descriptor.value = function(...args: any[]) {
// todo you can inject args into the description here if needed
return allure.step(description, () => {
console.log(`Running step: ${description}`);
return original.apply(this, args);
@korobochka
korobochka / poster.md
Last active May 9, 2021 17:39
Translation of an old Bolshevik poster

Workers of the world, unite!

FEMALE MUSLIM-WORKERS!

Kings, beys and khans used to TAKE AWAY YOUR RIGHTS. You [female] used to be a slave in a state, a slate in a factory, and a slave in a family.

Soviet rule gave you EQUAL RIGHTS WITH EVERYONE. It broke the chains which used to bind you.

DO PROTECT THE RULE OF WORKERS AND PEASANTS: IT'S YOUR RULE AS WELL, WORKER [female]!

@korobochka
korobochka / Solution.java
Last active June 11, 2022 21:04
Queen's Attack II
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.*;
import java.util.regex.*;
import java.util.stream.*;
import static java.util.stream.Collectors.joining;