Skip to content

Instantly share code, notes, and snippets.

Avatar

Илья Исаев isae

  • Okko
  • Saint-Petersburg
View GitHub Profile
@isae
isae / add_not_null_column.sh
Last active Dec 13, 2019
PostgreSQL: add NOT NULL column faster with minimal locking
View add_not_null_column.sh
#!/bin/sh
# Inspired by https://medium.com/doctolib/adding-a-not-null-constraint-on-pg-faster-with-minimal-locking-38b2c00c4d1c
if [ "$#" -ne 5 ]; then
echo "This script generates safe not-null column addition SQL script for large tables"
echo "Usage: $0 <table_name> <column_name> <column_type> <id_column_name> <default_value> > script.sql" >&2
exit 1
fi
table_name=$1
column_name=$2
column_type=$3
View makejar.bat
"C:\Program Files\Java\jdk1.8.0\bin\javac.exe" -classpath ".\src" src\ru\ifmo\ctddev\isaev\Implementor.java
"C:\Program Files\Java\jdk1.8.0\bin\javac.exe" -classpath ".\src" src\info\kgeorgiy\java\advanced\implementor\Impler.java
"C:\Program Files\Java\jdk1.8.0\bin\javac.exe" -classpath ".\src" src\info\kgeorgiy\java\advanced\implementor\ImplerException.java
cd ".\src"
"C:\Program Files\Java\jdk1.8.0\bin\jar.exe" cfe ..\Implementor.jar "ru.ifmo.ctddev.isaev.Implementor" "ru\ifmo\ctddev\isaev\Implementor.class" "info\kgeorgiy\java\advanced\implementor\Impler.class"
View Implementor.java
package ru.ifmo.ctddev.isaev;
import info.kgeorgiy.java.advanced.implementor.Impler;
import info.kgeorgiy.java.advanced.implementor.ImplerException;
import info.kgeorgiy.java.advanced.implementor.JarImpler;
import javax.tools.JavaCompiler;
import javax.tools.ToolProvider;
import java.io.*;
import java.lang.reflect.Constructor;
View Implementor.java
package ru.ifmo.ctddev.isaev;
import info.kgeorgiy.java.advanced.implementor.Impler;
import info.kgeorgiy.java.advanced.implementor.ImplerException;
import info.kgeorgiy.java.advanced.implementor.JarImpler;
import javax.tools.JavaCompiler;
import javax.tools.ToolProvider;
import java.io.*;
import java.lang.reflect.Constructor;
@isae
isae / cg_practice
Created Apr 14, 2014
Two linear sphere segments intersection checking with rough eps
View cg_practice
#include <QtCore/QCoreApplication>
//#include <QApplication>
#include <iostream>
#include <gmpxx.h>
#include <gmp.h>
#include <boost/numeric/interval.hpp>
#include <boost/math/constants/constants.hpp>
using namespace std;
using namespace boost::numeric;
@isae
isae / asfds.cpp
Created Apr 10, 2014
OS_homework1
View asfds.cpp
#include <iostream>
#include <fstream>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/wait.h>
int const MAX_FD_LENGTH = 10;
using namespace std;
View asm fact
#include <stdio.h>
#include <conio.h>
int __cdecl float_fact(int);
int main(){
int num=10;
printf("%f", float_fact(num));
_getch();
return 0;
}
View jar gen
"C:\Program Files\Java\jdk1.7.0_25\bin\javac.exe" -classpath ".\src" src\ru\ifmo\ctddev\isaev\Implementor.java
"C:\Program Files\Java\jdk1.7.0_25\bin\javac.exe" -classpath ".\src;..\java-advanced-2014\lib\*" src\info\kgeorgiy\java\advanced\base\*.java
"C:\Program Files\Java\jdk1.7.0_25\bin\javac.exe" -classpath ".\src;..\java-advanced-2014\lib\*" src\info\kgeorgiy\java\advanced\implementor\*.java
"C:\Program Files\Java\jdk1.7.0_25\bin\jar.exe" cfm ImplementorTest.jar META-INF\MANIFEST.MF ^
src\ru\ifmo\ctddev\isaev\Implementor.class ^
src\info\kgeorgiy\java\advanced\base\BaseTester.class ^
src\info\kgeorgiy\java\advanced\implementor\ClassImplementorTest.class ^
src\info\kgeorgiy\java\advanced\implementor\InterfaceImplementorTest.class ^
src\info\kgeorgiy\java\advanced\implementor\Impler.class ^
@isae
isae / javadoc.bat
Created Mar 19, 2014
javadoc creation
View javadoc.bat
javadoc.exe ^
-locale ru ^
-private ^
-splitindex ^
-use ^
-classpath ..\java-advanced-2014\lib\hamcrest-core-1.3.jar;^
..\java-advanced-2014\lib\junit-4.11.jar;^
..\java-advanced-2014\lib\quickcheck-0.6.jar;^
-author ^
-version ^
View test.bat
"C:\Program Files\Java\jdk1.7.0_25\bin\javac.exe" -classpath ".\src" ^
src\ru\ifmo\ctddev\isaev\Implementor.java
"C:\Program Files\Java\jdk1.7.0_25\bin\java.exe" -classpath .\src;^
..\java-advanced-2014\lib\hamcrest-core-1.3.jar;^
..\java-advanced-2014\lib\junit-4.11.jar;^
..\java-advanced-2014\lib\quickcheck-0.6.jar;^
..\Tests.jar ^
info.kgeorgiy.java.advanced.implementor.Tester class ru.ifmo.ctddev.isaev.Implementor