jw
03/25/2021, 12:11 PMLilly
03/25/2021, 3:03 PMval buffer = Buffer() // gets filled until a specific condition
val packetList = listOf(/*a list of bytearrays aka packets*)
packetList.forEach { packet ->
fun parse(buffer, packet) {
buffer.write(packet)
while (size != 0L) {
// do some read and skip operations
// need to remove 4 bytes from end of buffer, then return from parse and write the next packet until specific condition occurs
}
}
}
What I could do:
while (size != 0L) {
...
val tmpBuffer = Buffer()
buffer.copyTo(tmpBuffer, consumableRestOfBytes)
buffer.clear()
buffer.write(tmpBuffer.readByteArray())
return
...
But this might happen multiple times and it doesn't seem done properly.
Maybe I could achieve this in a different way. Could you or someone else have a look please?yschimke
03/25/2021, 6:22 PMNikky
03/25/2021, 6:23 PMderiveSchemaFromMigrations = true
or does nto pick it up, maybe because it is in a subproject?alec
03/25/2021, 10:46 PMalec
03/25/2021, 10:46 PMNikky
03/26/2021, 12:00 PMidea.log
filealec
03/26/2021, 12:31 PMalec
03/26/2021, 12:32 PMsaket
03/26/2021, 3:06 PMNikky
03/27/2021, 1:51 PMColton Idle
03/30/2021, 10:13 AMcompanyApiModule
and then just having that "library" consumed by my android app, a swing desktop app, and a cmd line text adventure app... right? So maybe this has nothing to do with kotlin multiplatform at all?
I'm a complete noob at all things not android (dont write swing apps or even cmd line apps) and so that's why I'm kinda second guessing myself here.jw
03/30/2021, 12:21 PMalex.tavella
03/31/2021, 12:01 PM[OkHttp]
Is there a safe way to set callTimeout
from an Interceptor
? From what I’ve read so far the proper way is to use a CallAdapter.Factory
but we really like the dynamism Interceptor
+ headers brings as we have a remote config per endpoint to configure the timeout remotely.jw
03/31/2021, 12:58 PMDaniele B
04/07/2021, 3:48 PMfun LocalDb.getCountriesList() : List<CountryData> {
return countriesQueries.getCountriesList(
mapper = { name, population, first_doses, fully_vaccinated ->
CountryData(name = name, population = population, firstDoses = first_doses, fullyVaccinated = fully_vaccinated)
}).executeAsList()
}
harry.singh
04/07/2021, 11:18 PM//Module A
sqldelight {
MyDatabase {
packageName = "com.package.name.A"
}
}
//Module B
sqldelight {
MyDatabase {
packageName = "com.package.name.B"
dependency project(':moduleA')
}
}
Module A have a single table which is accessed at app startup in the Application class. Module B have 2 tables and this module is dependent on table from Module A. The tables from Module B are accessed when the launcher activity has finished launching.
I create instance of MyDatabase
separately in each of the module:
MyDatabase(AndroidSqliteDriver(MyDatabase.Schema), context)
Now, when I launch the application, I see two instances of database in Android Studio's Database Inspector. First instance have only single table from Module A with the data inserted at Application class. Second instance, have 3 tables, 2 from Module B and 1 from Module A. The Module A table in second instance is empty.
Since, the name of the database is same in both of the modules, I expected only one database instance to have been created with each module creating tables in the same instance. Is there a way to setup SQLDelight to create only a single instance of the database for the application?Colton Idle
04/19/2021, 10:16 PMjw
04/19/2021, 10:36 PMColton Idle
04/19/2021, 11:20 PMby
e.g. class NewApi(realApi: Api) : Api by realApi
Last thing I suppose is if I wanted to fake 400s or 500s or something... I wouldn't be able to use the same solution as #2 right?
Edit: Or actually I think I could use
public static <T> Response<T> success(T body) {
public static <T> Response<T> success(T body, com.squareup.okhttp.Response rawResponse)
public static <T> Response<T> error(int code, ResponseBody body) {
Javier
04/19/2021, 11:21 PMColton Idle
04/19/2021, 11:45 PMjw
04/19/2021, 11:46 PMColton Idle
04/19/2021, 11:54 PMColton Idle
04/20/2021, 2:10 PMColton Idle
04/20/2021, 2:36 PMreturn delegate.returning(Calls.response("Colton Idle"))
edit: freakin slack formatting
jw
04/20/2021, 2:50 PMjw
04/20/2021, 2:50 PMjw
04/20/2021, 2:50 PMbody()