Gavin Ray
02/11/2023, 6:31 PM[from .. to]
on ByteArray
to do something like this?
operator fun ByteArray.get(intRange: IntRange): Byte {
val bytes = this.sliceArray(intRange)
return ByteBuffer.wrap(bytes).getInt()
}
fun getID(data: ByteArray): Int = data[0..3] as Int
Gavin Ray
02/11/2023, 6:31 PMAhsan Raza
02/13/2023, 9:52 AMNicholas Haggmark
02/14/2023, 11:27 PMArivnd Ramesh
02/15/2023, 1:49 AMAndy Alorwu
02/15/2023, 12:20 PMapplication.conf
file when using ktor.
I’m trying this for the first time so pardon me. I’ve created a conf file as follows:
ktor {
deployment {
port = 8080
}
application {
modules = [ com.example.ApplicationKt.module ]
}
}
jwt {
"secret" = ${m_secret}
"issuer" = "my_issuer"
….
}
I would like to extract the values for the jwt
properties into an environment file so that i don’t publish my secrets into version control. What’s the best way to do this? I tried accessing the value of ${m_secret}
from a dev.env
file which I set as m_secret="secret"
but that didn’t work as I run into the following error: Could not resolve substitution to a value: ${m_secret}
. Thanks in advance.ahmad
02/16/2023, 8:59 AMjOOQ
plugin and Flyway
.
I installed the pg_partman
and pg_cron
extensions on the local Postgres by creating a Dockerfile.postgres
file and used it in the docker-compose.yml
file.
So I am able to run pg_partman
and pg_cron
functions on my local db.
But the generateJooqClasses
fails to run those functions
ERROR: function partman.create_parent(p_parent_table => unknown, p_control => unknown, p_type => unknown, p_interval => unknown, p_premake => integer, p_start_partition => unknown, p_template_table => unknown) does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
I guess because generateJooqClasses
creates its own container which doesn’t have those extensions.
Any idea how to make it work? How to make the extensions available in this container?Łukasz Pięta
02/16/2023, 12:30 PMdata class
? I know that equals and hashcode need to be overridden then, but what about "The entity class must not be final*"* rule from JPA Specification? It can be easily solved by all-open compiler plugin as well. However it looks weird in the bytecode
@javax.persistence.Entity public open data class
I already found an issue https://youtrack.jetbrains.com/issue/KT-34568/All-open-plugin-does-not-support-data-classes and the answer
breakingbut I wonder what are the exact consequences of breaking thecontracts will eventually bring more harm than good.data class
data class
contractaazavoykin
02/17/2023, 5:11 PMErwin Pandawa5
02/18/2023, 2:53 AMHowie Nguyen
02/19/2023, 4:39 AMP A
02/22/2023, 11:00 PMZachary Siegel
02/24/2023, 10:43 PMsdeleuze
02/26/2023, 7:59 PMBrian Odisho
02/27/2023, 5:08 PMFanilog
02/28/2023, 11:43 AMprivate fun getPasswordBasedKey(password: CharArray): Key {
val salt = ByteArray(100)
val random = SecureRandom()
random.nextBytes(salt)
val pbeKeySpec = PBEKeySpec(password, salt, 1000, 128)
val pbeKey = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256").generateSecret(pbeKeySpec)
return SecretKeySpec(pbeKey.encoded, "AES")
}
Prasoon Agrawal
03/01/2023, 6:00 PMSlackbot
03/02/2023, 2:31 PMMoreno Flavio
03/06/2023, 12:37 PMthunderbiscuit
03/06/2023, 1:43 PMNigel Smith
03/09/2023, 4:41 PMmin
, max
etc - does it require a custom plugin to bridge, or I’m missing some way of doing this out of the box?Rob Elliot
03/09/2023, 4:55 PMJonathan Locke
03/10/2023, 10:05 PMMod
03/11/2023, 2:32 PMIsmaïl
03/15/2023, 7:41 PMianbrandt
03/20/2023, 5:13 PMaaverin
03/27/2023, 7:02 AMsdeleuze
03/27/2023, 7:51 AMSumanth Neerumalla
03/27/2023, 6:12 PMFabin
03/30/2023, 9:44 PM