Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View alexandreaquiles's full-sized avatar

Alexandre Aquiles alexandreaquiles

View GitHub Profile
@rponte
rponte / Proposal.kt
Last active April 10, 2022 12:43
JPA and Hibernate: best way to mapping a primary key as UUID in MySQL 8.x
@Entity
class Proposal(
val name: String,
//
@Column(columnDefinition = "binary(16)") // this works but uses a MySQL's specific type
val customerId: UUID
) {
@Id
@GeneratedValue
@rponte
rponte / using-uuid-as-pk.md
Last active April 22, 2024 21:42
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

public class Main {
static class Node {
final Object car;
final Node cdr = this;
Node(Object content) {
this.car = content;
}
@dunossauro
dunossauro / jit.py
Last active August 17, 2020 14:19
cc
"""
$ pip install numba
$ python jit.py
resultados:
$ python test_cc.py
Tempos com JIT
cc_0_jit - Min: 0.15884569298941642, Max: 0.1812134649953805, Mean: 0.16276181136781814
cc_1_jit - Min: 0.15603229100815952, Max: 0.18515240401029587, Mean: 0.16477074182126672
cc_2_jit - Min: 0.1618276800145395, Max: 0.25311970300390385, Mean: 0.17394073442847002
@rponte
rponte / Intervalo_t.sql
Last active January 19, 2022 16:21
PL/SQL: exemplo de Objeto com estado e comportamentos no Oracle - Intervalo (Date Range)
--------------------------------------------------------
-- Representa um Intervalo de datas (Date Range)
-- https://docs.oracle.com/cd/B10501_01/appdev.920/a96624/10_objs.htm
--------------------------------------------------------
create or replace type Intervalo_t FORCE as Object (
inicio Date
,fim Date
-- Construtores
,Constructor Function Intervalo_t(inicio Date, fim Date) Return Self as Result
@fmasanori
fmasanori / super salários USP.py
Created July 4, 2017 23:27
Super Salários USP
"""
Autores:
Tiago Henrique da Cruz Pereira
João Felipe de Moraes Borges
"""
import threading
import time
import os
from urllib.request import urlopen
{
"language": {
"javascript": {
"linting.prefer": "JSHint",
"linting.usePreferredOnly": true
}
}
}
@rponte
rponte / Sorteio.java
Last active January 19, 2023 19:34
Algoritimos: Encontrar menor lance (valor) único em uma lista
import static java.util.Comparator.naturalOrder;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.counting;
import static java.util.stream.Collectors.groupingBy;
import java.util.stream.Collectors;
import java.util.stream.Comparator;
import java.util.*;
public class Sorteio {
@rponte
rponte / get-latest-tag-on-git.sh
Last active March 11, 2024 07:50
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples