Skip to content

Instantly share code, notes, and snippets.

View yahorbarkouski's full-sized avatar
🚁

Yahor Barkouski yahorbarkouski

🚁
View GitHub Profile
public class ArrayUtils {
public static int[][] removeRow(int[][] array, int row) {
if (array == null || array.length == 0 || row < 0 || row >= array[0].length) {
return array;
}
int[][] newArray = new int[array.length][array[0].length - 1];
for (int i = 0; i < array.length; i++) {
for (int j = 0, k = 0; j < array[0].length; j++) {
@yahorbarkouski
yahorbarkouski / PGVectorBinding.kt
Last active July 10, 2024 01:26
Binding pgvector::vector type to List<Double> using jOOQ
import org.jooq.*
import org.jooq.impl.DSL
import java.sql.SQLFeatureNotSupportedException
import java.sql.Types
@Suppress("UNCHECKED_CAST")
class PGVectorBinding : Binding<Any, List<Double>> {
override fun converter(): Converter<Any, List<Double>> {
return object : Converter<Any, List<Double>> {