Skip to content

Instantly share code, notes, and snippets.

Ilya Korobitsyn korobochka

  • Saint Petersburg, Russia
Block or report user

Report or block korobochka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@korobochka
korobochka / decorators.ts
Last active Jan 11, 2019
Allure 2 Typescript step decorators
View decorators.ts
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 / Readme.md
Created Feb 2, 2017
Data Structures exam
View Readme.md

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):

View gist:26d5256a4d7601e9347b

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

Пример с JUnit:

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

    public void doSomething() {
        String s = "Some leaking string " + strings.size();
        strings.add(s);
View LeakAgentInterface.java
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();
View gist:9379154
/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
View fibbonacci.c
#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];
View binsearch.d
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;
View Finance.d
import std.stdio;
import std.parallelism;
import std.process;
import std.file;
int main()
{
auto f = File("ids.txt");
auto tp = new TaskPool(32);
You can’t perform that action at this time.